Skip to content

transform (coroutines): undef task handle in call to closure #1032

@asdine

Description

@asdine
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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions