-
Hi, I have some questions from the test suites. At this line:
The argument is
Which the 0th value in the table instance is
When invoking According to the spec of executing The question is, this matching should fail -- cannot find the matching rule of Can you help to explain the matching rule here? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
The cast succeeds because the dynamic type of The spec for Although @rossberg, it looks like the execution spec for the |
Beta Was this translation helpful? Give feedback.
-
To give a bit of background, this wart exists because the CG decided to cut nullref from Wasm 2.0, so that we had to introduce the (static) type annotation to determine the type of ref.null instructions. At the same time, this annotation should not have any dynamic meaning, since that would require engines to carry a runtime type around with each null reference, which clearly is undesirable. @tlively, can you clarify what is outdated? |
Beta Was this translation helpful? Give feedback.
The cast succeeds because the dynamic type of
ref.null any
isnullref
, i.e.(ref null none)
despite theany
annotation.nullref <: (ref null struct)
, so the cast succeeds and the branch is taken.The spec for
ref.null
where this behavior is described is here.Although @rossberg, it looks like the execution spec for the
ref.null
instruction is out of date.