Skip to content
This repository was archived by the owner on Apr 25, 2025. It is now read-only.

Explanation of type matching in br_on_cast instruction #507

Answered by tlively
q82419 asked this question in Q&A

You must be logged in to vote

The cast succeeds because the dynamic type of ref.null any is nullref, i.e. (ref null none) despite the any 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.

Replies: 2 comments 2 replies

You must be logged in to vote
1 reply
@q82419

Answer selected by q82419

You must be logged in to vote
1 reply
@tlively

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants