Remove type annotation on ref.is_null #99
Description
Before we removed anyref, the ref.is_null
instruction had a canonical type:
ref.is_null : [anyref] -> [i32]
One piece of the fallout from removing anyref was that this no longer worked. In order to avoid a dependency on the outcome of the wider discussion opened in WebAssembly/function-references#27, I added a type annotation on the instruction, so that it became
ref.is_null <reftype> : [<reftype>] -> [i32]
(with the understanding that the <reftype>
would later be refined to a <heaptype>
as per the typed (function) references proposal).
However, given that the discussion on WebAssembly/function-references#27 seems to show a common sentiment to avoid redundant type annotations -- especially considering the many more affected instructions added in something like the GC proposal -- it would be unfortunate if ref.is_null
became an outlier. And having adapted all the tests, I can say that it is quite annoying in practice, too (ref.null is tedious enough already).
So I propose removing the annotation and changing the instruction to
ref.is_null : [<reftype>] -> [i32]
such that the a linear validator simply has to check that there is some<reftype>
on the stack.
Thoughts?