func foo() {
ch := make(chan int)
fn := func(nb int) {
ch <- nb
}
go func() {
fn(10)
}()
fmt.Println(<-ch)
}
func main() {
foo()
}
This causes the following compilation error:
async function exp.foo$1 used as function pointer
The same happens when I replace the fn closure by a method.
I compiled to wasm using the 0.12.0 docker image with the following params:
docker run ... \
tinygo/tinygo:0.12.0 tinygo build -o /dist/exp.wasm -target wasm --no-debug exp