wasmtime-dotnet
wasmtime-dotnet copied to clipboard
Fix issues in `Function.FromCallback()` and `Linker.DefineFunction()`
Hi, this is a PR to fix the following issues when using Function.FromCallback()
and Linker.DefineFunction()
:
- Instead of invoking
callback.Method
(that may have a different parameter count than the callback), invoke the callback'sInvoke
method. - Handle an
ITuple
return value only whenGetFunctionType()
determined that the function returns a tuple, to correctly return a boxedValueTuple
asexternref
. - Support nested levels of
ValueTuple
s, so that it's possible e.g. to return aValueTulple<..., ValueTuple<..., ValueTuple<...>>>
(15 values).
Fixes #158 Fixes #159
Thank you!