Closed q82419 closed 4 years ago
The point of this test is that this is no longer needed, per the resolution of https://github.com/WebAssembly/reference-types/issues/76. The occurrences in the other declarations are sufficient.
This was the reply to the same question in https://github.com/WebAssembly/reference-types/pull/95
Got it, thanks.
All ocurrences of ref.func
in the module environment
are treated as declaring a valid ref.func
target for the code
section.
In the above module, the export
and global
section reference to $f1
and $f2
, so the (elem declare func $f1 $f2)
is not needed. Right?
As far as I understand, it's not needed.
Yes, that's correct.
If I'm correct, the test case in
core/ref_func.wast
should not pass. https://github.com/WebAssembly/reference-types/blob/master/test/core/ref_func.wast#L80-L106The following test case got an expected invalid result:
Because the
$f
is not declared inelem
.I think it needs to add
(elem declare func $f1 $f2)
or(elem declare funcref (ref.func $f1) (ref.func $f2))
into the module in the above mentioned test case? That is: