-
Notifications
You must be signed in to change notification settings - Fork 676
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
Type funcref crash due to ref type getting read as "any" type instead of a ref type #1881
Comments
It turned out that the crash in this issue wasn't due to an issue with type-checking, it seems to actually be a parsing bug so I've renamed the issue. I'll file a separate issue for the actual subtyping things we should add. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A test like the following currently crashes in type-checking:
Error:
I think the immediate reason is that type checking should account for subtyping, and make sure to compare heap types instead of assuming all reference types have an index (i.e., are a "concrete reference type" as described in the GC spec).
More generally, I think the type-checker needs to also be extended to look at the type section (or a more abstract "type store") to look up type indices when checking equality of concrete types. Alternatively, concrete ref types should be stored pre-canonicalized as a pointer (this would depend on #1828) to a representative type in the canonicalized type store.
These are all needed eventually for GC support too.
The text was updated successfully, but these errors were encountered: