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

fail does not typecheck at the WebAssembly level #1192

Open
ospencer opened this issue Apr 21, 2022 · 0 comments
Open

fail does not typecheck at the WebAssembly level #1192

ospencer opened this issue Apr 21, 2022 · 0 comments

Comments

@ospencer
Copy link
Member

ospencer commented Apr 21, 2022

At the WebAssembly level, Grain "any" types are i32s but this block needs to return an i64 like the others. We got around this before by this being a call_indirect—we just lied about what type fail returned. At runtime, instead of raising Failure, this is a call_indirect typechecking error.

Essentially, we need a compiler primitive for fail which can print the error and then generate unreachable. (But we can't do that until the enum refactor is done because Failure would need to be baked into the compiler.)

Originally posted by @ospencer in #1175 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants