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

OneofObject restriction on variant types #923

Closed
nicolaiunrein opened this issue May 14, 2022 · 3 comments
Closed

OneofObject restriction on variant types #923

nicolaiunrein opened this issue May 14, 2022 · 3 comments
Labels
question Further information is requested

Comments

@nicolaiunrein
Copy link
Collaborator

Hey folks,
just played around with the OneofObject and wondered why there is a restriction on the inner type being unique? It is a tagged enum representation after all so imo this should be fine:

#[derive(OneofObject)]
enum Filter {
    Any(Vec<String>),
    All(Vec<String>)
}

but I get an error: This type already used by another variant

Note: there is actually a spelling mistake in the error message. It should say This type is already used by another variant

@nicolaiunrein nicolaiunrein added the question Further information is requested label May 14, 2022
@nicolaiunrein nicolaiunrein changed the title <Title> OneofObject restriction on variant types May 14, 2022
@sunli829
Copy link
Collaborator

It's a bug,will fix it now😃

@sunli829
Copy link
Collaborator

Fixed in 4.0.0-alpha.2

@nicolaiunrein
Copy link
Collaborator Author

thanks

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

No branches or pull requests

2 participants