Closed yviansu closed 1 year ago
In the example of wasm imports <- wasm exports, the exported function increment in counter.wasm has no return value, when importing function increment in main.wasm, why setting the function's result type is i32?
wasm imports <- wasm exports
increment
counter.wasm
main.wasm
i32
;; main.wat --> main.wasm (module (import "./counter.wasm" "count" (global i32)) (import "./counter.wasm" "increment" (func $increment (result i32))) ) ;; counter.wat --> counter.wasm (module (func (export "increment") (global.set 0 (i32.add (global.get 0) (i32.const 1)))) (global (export "count") (mut i32) i32.const 5) )
That seems like nothing more than an err on part of the author - I'll review and report back, or make a PR.
In the example of
wasm imports <- wasm exports
, the exported functionincrement
incounter.wasm
has no return value, when importing functionincrement
inmain.wasm
, why setting the function's result type isi32
?