Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect type for ref.func when function references are enabled #2241

Closed
14427 opened this issue May 28, 2023 · 1 comment
Closed

Incorrect type for ref.func when function references are enabled #2241

14427 opened this issue May 28, 2023 · 1 comment

Comments

@14427
Copy link

14427 commented May 28, 2023

The following wat program works fine in wat2wasm without function references enabled:

(module
  (func $example (export "example") (result funcref)
    ref.func $example))

However, enabling the "function references" feature causes the following error:

Error: validate failed:
test.wast:3:5: error: type mismatch in implicit return, expected [funcref] but got [(ref 0)]
    ref.func $example))
    ^^^^^^^^

It looks like ref 0 is not marked as a subtype of funcref.

Tested with the online demo: https://webassembly.github.io/wabt/demo/wat2wasm/

@keithw
Copy link
Member

keithw commented May 29, 2023

Thank you for testing this! As with #2097 and #1986 and #1987 and #2089, AFAIK support for the function-references proposal remains a work in progress in WABT. We don't even mention function references in the README, and we're not running the function-references tests. (I think function-references may have been folded into the "gc" proposal in the meantime, but not sure?)

I think somebody who is interested in pushing this forward will have to complete support for the function-references or gc proposals, and claim support in the README, and add the proposal spec tests to WABT's testsuite, before we'd expect function references to work properly. Closing as essentially a dup of #1377 . If you want to work on this, we'd be very happy to help / review contributions that get these proposals supported!

@keithw keithw closed this as completed May 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants