-
Notifications
You must be signed in to change notification settings - Fork 13
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
go:wasmexport: unsupported parameter type #185
Comments
golang/go#66984 fixes this |
Thanks, I have not seen this yet. I will read through it and follow up. Regardless, would you prefer I close this issue or leave it open until we can confirm the behavior outlined has been implemented/validated? |
Sure, let's leave this open to track. |
According to the proposal:
But when I generate from this:
It generates this: //go:wasmexport upper
//export upper
func wasmexport_Upper(input0 *uint8, input1 uint32) (result *string) { Would it be fair to say this would be in error, even after the proposal is integrated? |
A pointer to a string is a single i32, so it is valid as a return value. |
Work is being done in Go 1.24 to support go:wasmexport.
However, there are a handful of unsupported parameter types. The following test shows the supported and unsupported types https://go-review.googlesource.com/c/go/+/611315
*string, and *uint8 are examples I have run into with the current wit-bindgen-go bindings.
Is it a possible solution to use
unsafe.Pointer
and convert the parameters to their necessary types?I.e
Breaking
Possible workaround
I am still working through a test to ensure this functionality works. I am currently working through the reactor host setup to call the exported function.
The text was updated successfully, but these errors were encountered: