diff --git a/.devcontainer/setup.sh b/.devcontainer/setup.sh old mode 100644 new mode 100755 index 4a527de76..192d4dc21 --- a/.devcontainer/setup.sh +++ b/.devcontainer/setup.sh @@ -29,6 +29,8 @@ curl -fsSL https://cli.moonbitlang.com/install/unix.sh | bash echo 'export PATH="$HOME/.moon/bin:$PATH"' >> ~/.bashrc # Go -curl -OL https://go.dev/dl/go1.25.5.linux-amd64.tar.gz -tar xf go1.25.5.linux-amd64.tar.gz -echo "export PATH=$HOME/go1.25.5.linux-amd64/bin:\$PATH" >> ~/.bashrc +GO="go-$(uname -s | tr 'A-Z' 'a-z')-$(uname -m | sed -e 's/aarch64/arm64/' -e 's/x86_64/amd64/')-bootstrap" +curl -OL https://github.com/dicej/go/releases/download/go1.25.5-wasi-on-idle/$GO.tbz +tar xf $GO.tbz +rm $GO.tbz +echo "export PATH=$HOME/$GO/bin:\$PATH" >> ~/.bashrc diff --git a/crates/go/src/lib.rs b/crates/go/src/lib.rs index 19899fc82..9d9067fc0 100644 --- a/crates/go/src/lib.rs +++ b/crates/go/src/lib.rs @@ -1006,7 +1006,7 @@ impl Go { format!( "{params_pointer} := wit_runtime.Allocate({PINNER}, {size}, {align})\n{code}" ), - vec![params_pointer], + vec![format!("uintptr({params_pointer})")], ) } else { let wasm_params = go_param_names diff --git a/crates/test/src/cpp.rs b/crates/test/src/cpp.rs index c88b9ed5d..e2d1b7b83 100644 --- a/crates/test/src/cpp.rs +++ b/crates/test/src/cpp.rs @@ -51,7 +51,8 @@ impl LanguageMethods for Cpp { | "futures.wit" | "resources-with-futures.wit" | "resources-with-streams.wit" - | "streams.wit" => true, + | "streams.wit" + | "async-resource-func.wit" => true, _ => false, } } diff --git a/crates/test/src/csharp.rs b/crates/test/src/csharp.rs index 074d76696..f4fb650fb 100644 --- a/crates/test/src/csharp.rs +++ b/crates/test/src/csharp.rs @@ -47,6 +47,7 @@ impl LanguageMethods for Csharp { | "streams.wit" | "error-context.wit" | "resource-fallible-constructor.wit" + | "async-resource-func.wit" ) } diff --git a/tests/codegen/async-resource-func.wit b/tests/codegen/async-resource-func.wit new file mode 100644 index 000000000..b9704c1f2 --- /dev/null +++ b/tests/codegen/async-resource-func.wit @@ -0,0 +1,14 @@ +package foo:bar; + +world bindings { + import types; +} + +interface types { + resource descriptor { + test: async func( + arg1: string, + arg2: list, + ); + } +}