-
Notifications
You must be signed in to change notification settings - Fork 251
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
wasmparser: "duplicate identifier for field" in subtype #1092
Comments
Thanks for filing an issue! Just a heads up, our GC support is very much still a work in progress. |
cc @imikushin |
Like most other tooling out there ;) Appreciate your work on this |
Added a simple fix for this to #1059 which happens to add subtype support to wasmparser :) |
Okay, the fix above will work, but with one caveat: field namespace is global per module. So, current limitation: fields with the same name can only be at the same position, even in totally different structs 😅 |
This works for my use-case since field names are distinct in unrelated structs. But I guess the spec won't allow for this limitation. Also, with #1059 I am able to successfully assemble my webassembly text file (at least at the current state, my codegen is still missing a ton of things). |
@patrick96 unfortunately, by @alexcrichton 's suggestion (#1059 (comment)), I had to remove the temporary dirty fix from #1059 . Good news is I'm going to send a proper fix after #1059 is merged. |
That's fine, keep doing what you're doing :) |
Field namespaces are per struct now. Inherited fields' names must be exactly the same as in the super-type. Fixes bytecodealliance#1092.
Submitted a fix ⬆️ |
Field namespaces are per struct now. Inherited fields' names must be exactly the same as in the super-type. Fixes bytecodealliance#1092.
* Fix "duplicate identifier for field" for subtype fields Field namespaces are per struct now. Inherited fields' names must be exactly the same as in the super-type. Fixes #1092. * Remove some unused imports * Address review comments * Address review comments * Fix a broken test
Awesome! Thanks for all your efforts |
For the following module:
I get the following output:
For subtypes, the same field in the subtype has to have the same name as in the supertype, otherwise it's impossible to do any kind of field manipulation unless you know the exact type of the object.
In fact, the spec for the gc proposal says:
This happens both on
main
(0263c2f) and version 1.0.35.The text was updated successfully, but these errors were encountered: