Imported Functions with a Void return type
See original GitHub issueAre imported functions (FunctionImport) with a void return type supported by DNWASM?
I was trying to load a fairly simple wasm file that relied on function import, whose expected signature type matches (type $t1 (func (param i32))).
I provided my .NET-defined function using various forms but they all produced errors, her are a couple of the obvious ones:
| My Func | Error |
|---|---|
public static void foo(int c) |
Parameter name: Return type System.Void is not compatible with WebAssembly. |
public static int foo(int c) |
Unhandled Exception: WebAssembly.CompilerException: env::putc_js did not match the required type signature. |
Issue Analytics
- State:
- Created 5 years ago
- Comments:12 (5 by maintainers)
Top Results From Across the Web
A function whose declared type is neither 'void' nor 'any' ...
You've declared ISignInData as the return type. But the method doesn't return anything. Just change it to void if you don't plan on...
Read more >Documentation - More on Functions
Function Type Expressions ... The syntax (a: string) => void means “a function with one parameter, named a , of type string ,...
Read more >Void Type in Java
Since JDK 1.1, Java provides us with the Void type. Its purpose is simply to represent the void return type as a class...
Read more >How to Import Some (void *) Returning Type Function into ...
I created a C# console project that will use the C++ function. I know that there will be some void * variable passing,...
Read more >Functions with (non-void) Return Types
In functions that have non-void return types (dont worry, ... This little program starts out with the import statement and the main function....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

You’re welcome to write up a new issue for every different problem you encounter.
This project has struggled with a lack of low-complexity WASM files to test against. I’m happy you pointed out WebAssembly Studio, which I wasn’t previously aware of. It seems like a great resource to resolve that limitation.
This should be fixed with 0.3.3-preview.