<!-- Please answer these questions before submitting your issue. Thanks! For questions please use one of our forums: https://github.com/golang/go/wiki/Questions --> ### What version of Go are you using (`go version`)? <pre> $ go version go version devel go1.18 </pre> ### Does this issue reproduce with the latest release? Yes ### What operating system and processor architecture are you using (`go env`)? <details><summary><code>go env</code> Output</summary><br><pre> $ go env </pre></details> ### What did you do? <!-- If possible, provide a recipe for reproducing the error. A complete runnable program is good. A link on play.golang.org is best. --> ```go package main type Foo[T any] struct { } func (foo Foo[T]) Get() { } var( _ = Foo[[]string]{}.Get ) func main() { } ``` ### What did you expect to see? ### What did you see instead? ``` [signal SIGSEGV: segmentation violation code=0x1 addr=0x80 pc=0x17c49ff] goroutine 1 [running]: cmd/compile/internal/noder.(*irgen).buildClosure(0xc0002fa200, 0x0, {0x1a63778, 0xc0003c2300}) /Users/kezhao/google/go/src/cmd/compile/internal/noder/stencil.go:405 +0xc7f ``` @danscales
Activity
thanm commentedon Sep 7, 2021
@randall77 @danscales
gopherbot commentedon Sep 9, 2021
Change https://golang.org/cl/348512 mentions this issue:
cmd/compile: fix implement for closure in a global assignmentcmd/compile: fix implement for closure in a global assignment