Closed
Description
Bug description
usage of closure cannot be diagnosed in assignment statement
Steps to reproduce
compiler following code
function foo(): () => void {
let a = 100;
let bar = (): void => {
a = 10;
return;
};
return bar;
}
foo();
And then got validate error
[wasm-validator error in function assembly/index/foo~anonymous|0] unexpected false: local.set index must be small enough, on
(local.set $0
(i32.const 10)
)
FAILURE /Users/assemblyscript/cli/index.js:770
return prepareResult(Error("validate error"));
AssemblyScript version
v0.27.x