This failure case could be equally valid as "type mismatch" if a validator is validating one opcode at a time rather than consuming them all then validating the return type.
It wants a ref.func but the first opcode it finds is an i32.const so a streaming validator should be able to error on the first opcode rather than wait for more to decide that it's not a constant expression.
I can't think of an alternative to replace this with, so I'm suggesting this case is unnecessary and too ambiguous.
This failure case could be equally valid as "type mismatch" if a validator is validating one opcode at a time rather than consuming them all then validating the return type.
It wants a
ref.func
but the first opcode it finds is ani32.const
so a streaming validator should be able to error on the first opcode rather than wait for more to decide that it's not a constant expression.I can't think of an alternative to replace this with, so I'm suggesting this case is unnecessary and too ambiguous.