-
-
Notifications
You must be signed in to change notification settings - Fork 670
Compiler error on call_indirect/function pointer #2349
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
Comments
Yeah. It looks like binding generator doesn't support functions as argument during codegen. |
For now can you could just remove |
Yes, that works for the simple repro above. It's not possible in my more real use case unfortunately where actually it is the host runtime that has to call |
Well In this case, you can refactor you code to this: function increment(input: i32): i32 {
return input + 1;
}
export function callback(fn: i32, input: i32): i32 {
return call_indirect(fn, input);
}
export function call(input: i32): i32 {
return callback(increment.index, input);
} add Example in playground Or wait for fix this bindgen issue =) |
Amazing. Thanks! |
Simple program to reproduce:
The text was updated successfully, but these errors were encountered: