-
Notifications
You must be signed in to change notification settings - Fork 146
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
Rust Enum in Struct in Enum causes bottom level enum constructor to change type? #901
Comments
Seems like only 1 nested enum (i.e. enum in enum) is needed to trigger the same behaviour. The test repo has been updated to reflect that |
Defining recursive types is not possible by deriving VmType as is atm. What you can do is define the types in gluon also and then use the |
I'm not using recursive types here, but are nested foreign enums also not supported? Also In my use case, I want to pass the types from Gluon to Rust and from Rust to Gluon, so I have to use |
The opaque return type was likely a quick hack that went unnoticed. I also had to force caching on the enum since the `Symbol` values created for the variants and the returned enum will otherwise be different between multiple `VmType::make_type` invocations (unless Fixes gluon-lang#901
My bad, misread it. Fixed in #902 |
The opaque return type was likely a quick hack that went unnoticed. I also had to force caching on the enum since the `Symbol` values created for the variants and the returned enum will otherwise be different between multiple `VmType::make_type` invocations (unless Fixes gluon-lang#901
Minimum example needed to reproduce
Basically I have types in Rust like these:
And if I try to initialize
E1
with:Then I get the following:
So it seems like suddenly
E2
's constructor(s) have changed (ifE2
has multiple variants they all get changed). Note that this also happens in the repl*, but (assumingtest
is the module containing the types) when I try:t import! test
it shows all types correctly, but if I try:t let { E1 } = import! test in S1
then it also shows the wrong type.[*] The repl included in the test repo is basically the one taken from
gluon
, exceptColor
is removed and the repl is run from a providedThread
.The text was updated successfully, but these errors were encountered: