-
Notifications
You must be signed in to change notification settings - Fork 40
Fix classes inside functions #386
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
Conversation
|
Could you please add a description of what this specifically fixes and how you fixed the problem? |
|
Please merge with upstream and address @Derppening's comment. |
Ok. I added it to description of this pr. |
Why would we need this? It seems to me that you should just make one pass to register all the types of the program, and then a separate pass to generate the code of functions. |
I thought that there might be some complications with correct order of registering types. I will try to implement preregistering of all types. Also, by all types you mean top-level classes? Can you clarify this? |
Yes. Not sure what else you think I could mean. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of the changes look good, please address the following comments.
Please also all brief documentation for new private functions.
Wasm backend crashes when classes defined in an outer scope are referenced inside nested functions (field access and class pattern matching). Fix: implemented lazy/on-demand creation/registration of top-level class struct types during lowering so the needed wasm type exists at each use site.