]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: fix nongeneric closures in generic functions
authorKeith Randall <khr@golang.org>
Mon, 26 Apr 2021 21:13:19 +0000 (14:13 -0700)
committerKeith Randall <khr@golang.org>
Tue, 27 Apr 2021 19:30:11 +0000 (19:30 +0000)
commitf432d3fc41b8f6b01131023aabcf935ebea172cb
treec1bc6adf07fba87d7e3e99763fd067a63b679299
parent8ab7064e33667f17b8d23b5db63468199c3eac02
cmd/compile: fix nongeneric closures in generic functions

Ensure that formal parameter Names are correctly copied and marked
with the correct Curfn. We need to ensure this even when the underlying
closure has no type parameters.

(Aside: it is strange that the types of things contain formal
parameter names that need to be copied. Maybe that's an underlying
larger problem that needs to be fixed.)

Fixes #45738

Change-Id: Ia13d69eea992ff7080bd44065115bc52eb624e73
Reviewed-on: https://go-review.googlesource.com/c/go/+/313652
Trust: Keith Randall <khr@golang.org>
Trust: Dan Scales <danscales@google.com>
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dan Scales <danscales@google.com>
src/cmd/compile/internal/escape/escape.go
src/cmd/compile/internal/noder/stencil.go
test/typeparam/issue45738.go [new file with mode: 0644]