-
Notifications
You must be signed in to change notification settings - Fork 15
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
Remove type annotations on ref.as_non_null and br_on_null #31
Conversation
@jakobkummerow, @lars-t-hansen, let me know if you think this looks reasonable. (See the pseudo code algorithm in the appendix to get an impression of how it affects a validator.) |
Looks reasonable. |
Wait, what bottom type? |
Looks plausible. |
Polymorphic type used when stack underflows in unreachable code. |
Is |
(did anyone notice that |
I can't find anything about a bottom type in the overview. Where should I look for more details about it? |
If I understand the history correctly: Added as |
Oh, |
No, not |
Oh, I see. It’s not part of the spec; it’s just a device used in the reference implementation. Is that right? |
I believe so, but I'll let @rossberg confirm. |
It will appear in the spec, but only as an internal type. You cannot use it in a program. Similar as with the bottom value type that was previously in the reftypes proposal. |
You'll need both. The latter matches any value type whatsoever, the former only reference types. When you have determined that an operand is a ref type you must not lose that information. Rules out
(cf.
It shouldn't be. It's a bottom type, not a top type. |
Got it. Thanks for the explanation! |
LGTM, thanks! |
Following WebAssembly/reference-types#99 and addressing issue #27, this removes the type annotations from
ref.as_non_null
andbr_on_null
(they already were absent oncall_ref
andfunc.bind
).One small caveat is that this requires extending the bottom type to a bottom heap type, to be able to type an unknown reference type in an instruction output.