]> Cypherpunks repositories - gostls13.git/commit
cmd/compile/internal/importer: key tparams by Package instead of pkgname
authorRobert Findley <rfindley@google.com>
Mon, 21 Mar 2022 20:08:38 +0000 (16:08 -0400)
committerRobert Findley <rfindley@google.com>
Tue, 22 Mar 2022 21:38:10 +0000 (21:38 +0000)
commitfd1b5904ae7cc76eefd94d315f92265da5b81b14
treea37f42d355dfff868fa8ac71b05a626c866441f1
parent212bda066996d1ed06e738c8b408bb2b65896064
cmd/compile/internal/importer: key tparams by Package instead of pkgname

The importer type param index used package name type parameter key,
causing type parameters to be reused/overwritten if two packages in the
import graph had the same combination of (name, declaration name, type
parameter name).

Fix this by instead using the *Package in the key.

Fixes #51836

Change-Id: I881ceaf3cf7c1ab4e0835962350feb552e79b233
Reviewed-on: https://go-review.googlesource.com/c/go/+/394219
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
src/cmd/compile/internal/importer/iimport.go
src/go/internal/gcimporter/iimport.go
test/typeparam/issue51836.dir/a.go [new file with mode: 0644]
test/typeparam/issue51836.dir/aa.go [new file with mode: 0644]
test/typeparam/issue51836.dir/p.go [new file with mode: 0644]
test/typeparam/issue51836.go [new file with mode: 0644]