]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: look for function in instantiations in all global assignments
authorDan Scales <danscales@google.com>
Wed, 14 Apr 2021 21:54:14 +0000 (14:54 -0700)
committerDan Scales <danscales@google.com>
Thu, 15 Apr 2021 00:14:55 +0000 (00:14 +0000)
commitbf634c76b28a4a857c9d2a039c53982ffbdcceb7
tree7a9d022e51719f6671861d98d3e58d40efc7fcdb
parent567a9322ad1980d22896efc3b642eedf997eb6d9
cmd/compile: look for function in instantiations in all global assignments

Add in some missing global assignment ops to the list of globals ops
that should be traversed to look for generic function instantiations.
The most common other one for global assigments (and the relevant one
for this bug) is OAS2FUNC, but also look at global assigments with
OAS2DOTTYPE, OAS2MAPR, OAS2RECV, and OASOP.

Bonus small fix: get rid of -G=3 case in ir.IsAddressable. Now that we
don't call the old typechecker from noder2, we don't need this -G-3
check anymore.

Fixes #45547.

Change-Id: I75fecec55ea0d6f62e1c2294d4d77447ed9be6ae
Reviewed-on: https://go-review.googlesource.com/c/go/+/310210
Trust: Dan Scales <danscales@google.com>
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Dan Scales <danscales@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
src/cmd/compile/internal/ir/expr.go
src/cmd/compile/internal/noder/stencil.go
test/typeparam/issue45547.go [new file with mode: 0644]