Skip to content

Fix empty interface compile crash #2197

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

Merged
merged 4 commits into from
Feb 11, 2022

Conversation

romdotdog
Copy link
Contributor

A while ago I reverse engineered the stack trace of #2085 to find this bug

Since interfaces are extended from classes, the asserts can be modified to check for interfaces.

  • I've read the contributing guidelines
  • I've added my name and email to the NOTICE file

@dcodeIO
Copy link
Member

dcodeIO commented Feb 7, 2022

Right now, interfaces only describe what's present in classes that implement them, but don't have own storage. These are more like types. As such, constructing an interface from an object literal, as in the test, would be limited to this exact test case where there is no actual data. Is this the intention, to just unblock this specific case?

@romdotdog
Copy link
Contributor Author

I see what you mean. Implementing hidden classes that implement interfaces would solve this problem more elegantly than just adjusting asserts, though this solution would work. I guess I will just have to wait for interface hidden classes to be implemented. Would a better temporary solution be to error when using interfaces in this fashion?

@dcodeIO
Copy link
Member

dcodeIO commented Feb 8, 2022

Producing a proper error seems preferable for now, yeah, until we know more. Hitting the asserts there is definitely a bug.

@dcodeIO dcodeIO merged commit fa14b3b into AssemblyScript:main Feb 11, 2022
@dcodeIO
Copy link
Member

dcodeIO commented Feb 11, 2022

Thanks! :)

@romdotdog romdotdog deleted the empty-interface branch February 11, 2022 13:39
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

Successfully merging this pull request may close these issues.

2 participants