New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xs:choice of nillable elements generate uncompilable code #162

Closed
rajish opened this Issue Jun 19, 2012 · 1 comment

Comments

Projects
None yet
2 participants
@rajish

rajish commented Jun 19, 2012

I've found a set of schema files that scalaxb transforms to the code that don't compile, giving the following errors:

generated /home/rajish/proj/muse/target/scala-2.9.1/src_managed/main/models/trace-report.scala.
generated /home/rajish/proj/muse/target/scala-2.9.1/src_managed/main/models/xinclude.scala.
generated /home/rajish/proj/muse/target/scala-2.9.1/src_managed/main/models/dictionary.scala.
generated /home/rajish/proj/muse/target/scala-2.9.1/src_managed/main/models/glossary.scala.
generated /home/rajish/proj/muse/target/scala-2.9.1/src_managed/main/models/use-case.scala.
generated /home/rajish/proj/muse/target/scala-2.9.1/src_managed/main/models/replacement-elements.scala.
generated /home/rajish/proj/muse/target/scala-2.9.1/src_managed/main/models/actors.scala.
generated /home/rajish/proj/muse/target/scala-2.9.1/src_managed/main/models/requirements.scala.
generated /home/rajish/proj/muse/target/scala-2.9.1/src_managed/main/models/data-types.scala.
generated /home/rajish/proj/muse/target/scala-2.9.1/src_managed/main/models/stakeholders.scala.
generated /home/rajish/proj/muse/target/scala-2.9.1/src_managed/main/XuseProtocol/xmlprotocol.scala.
generated /home/rajish/proj/muse/target/scala-2.9.1/src_managed/main/scalaxb/scalaxb.scala.
[info] Compiling 19 Scala sources and 1 Java source to /home/rajish/proj/muse/target/scala-2.9.1/classes...
[error] /home/rajish/proj/muse/target/scala-2.9.1/src_managed/main/XuseProtocol/xmlprotocol.scala:1942: type mismatch;
[error]  found   : models.StakeholderrefType
[error]  required: Option[models.ReferenceTypegroupOption]
[error]       (x => scalaxb.DataRecord(x.namespace, Some(x.name), scalaxb.fromXML[models.StakeholderrefType](x, scalaxb.ElemName(node) :: stack)))))
[error]                                                                                                     ^
[error] /home/rajish/proj/muse/target/scala-2.9.1/src_managed/main/XuseProtocol/xmlprotocol.scala:1940: type mismatch;
[error]  found   : ModelsReferenceTypegroupGroupFormat.this.Parser[scalaxb.DataRecord[Product with Serializable with models.ReferenceTypegroupOption]]
[error]  required: ModelsReferenceTypegroupGroupFormat.this.Parser[scalaxb.DataRecord[Option[models.ReferenceTypegroupOption]]]
[error]       (x => scalaxb.DataRecord(x.namespace, Some(x.name), scalaxb.fromXML[models.ActorrefType](x, scalaxb.ElemName(node) :: stack)))) | 
[error]                                                                                                                                       ^
[error] /home/rajish/proj/muse/target/scala-2.9.1/src_managed/main/XuseProtocol/xmlprotocol.scala:1952: type mismatch;
[error]  found   : models.StakeholderrefType
[error]  required: Option[models.ReferenceTypegroupOption]
[error]       (x => scalaxb.DataRecord(x.namespace, Some(x.name), scalaxb.fromXML[models.StakeholderrefType](x, scalaxb.ElemName(node) :: stack)))))
[error]                                                                                                     ^
[error] /home/rajish/proj/muse/target/scala-2.9.1/src_managed/main/XuseProtocol/xmlprotocol.scala:1950: type mismatch;
[error]  found   : ModelsReferenceTypegroupGroupFormat.this.Parser[scalaxb.DataRecord[Product with Serializable with models.ReferenceTypegroupOption]]
[error]  required: ModelsReferenceTypegroupGroupFormat.this.Parser[scalaxb.DataRecord[Option[models.ReferenceTypegroupOption]]]
[error]       (x => scalaxb.DataRecord(x.namespace, Some(x.name), scalaxb.fromXML[models.ActorrefType](x, scalaxb.ElemName(node) :: stack)))) | 
[error]                                                                                                                                       ^
[error] four errors found
[error] {file:/home/rajish/proj/muse/}muse/compile:compile: Compilation failed

The files are stored here, and the whole project (which happens to be written for the Play! framework) can be found here.

@eed3si9n eed3si9n closed this in 9488406 Dec 10, 2012

@eed3si9n

This comment has been minimized.

Show comment
Hide comment
@eed3si9n

eed3si9n Dec 10, 2012

Owner

scalaxb 1.0.0-RC3 is out with the fix. see https://github.com/eed3si9n/scalaxb-sample/tree/muse/muse

Owner

eed3si9n commented Dec 10, 2012

scalaxb 1.0.0-RC3 is out with the fix. see https://github.com/eed3si9n/scalaxb-sample/tree/muse/muse

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment