Skip to content
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

Derive macro panicks on anyType #43

Open
mtorromeo opened this issue Apr 30, 2024 · 0 comments
Open

Derive macro panicks on anyType #43

mtorromeo opened this issue Apr 30, 2024 · 0 comments

Comments

@mtorromeo
Copy link

Hi,
while trying to derive structs from some xsd I experienced a panic in the derive macro with an unhelpful message:

error: proc-macro derive panicked
  --> src/main.rs:16:17
   |
16 | #[derive(Debug, XmlSchema)]
   |                 ^^^^^^^^^
   |
   = help: message: called `Option::unwrap()` on a `None` value

I tracked down the problem in the handling of anyType.

This is the minimal reproducible xsd that I could come up with:

<?xml version="1.0" encoding="UTF-8"?>

<schema xmlns="http://www.w3.org/2001/XMLSchema">

    <complexType name="mixedType">
        <complexContent>
            <restriction base="anyType"></restriction>
        </complexContent>
    </complexType>

</schema>

The panick is triggered by this unwrap:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant