aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/types2/builtins.go
diff options
context:
space:
mode:
authorRob Findley <rfindley@google.com>2021-06-11 12:40:42 -0400
committerRobert Findley <rfindley@google.com>2021-07-19 17:42:35 +0000
commitc6d3d0b0ad10926fc1952deda913d139ed608cb3 (patch)
tree6701269be356d7b7110e1d0f3e191d43f7681b49 /src/cmd/compile/internal/types2/builtins.go
parent6bf2667d4ef7dee76d308c0ac7acd0d409213b8a (diff)
downloadgo-c6d3d0b0ad10926fc1952deda913d139ed608cb3.tar.gz
go-c6d3d0b0ad10926fc1952deda913d139ed608cb3.zip
[dev.typeparams] go/types: fix the type parameter index in applyTypeFunc
We should preserve type parameter indices when transforming them using applyTypeFunc. Change-Id: Ib75f5cf1a146bd7e6850368fa954c1affcba3ad1 Reviewed-on: https://go-review.googlesource.com/c/go/+/327269 Trust: Robert Findley <rfindley@google.com> Run-TryBot: Robert Findley <rfindley@google.com> Reviewed-by: Robert Griesemer <gri@golang.org> TryBot-Result: Go Bot <gobot@golang.org>
Diffstat (limited to 'src/cmd/compile/internal/types2/builtins.go')
-rw-r--r--src/cmd/compile/internal/types2/builtins.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/compile/internal/types2/builtins.go b/src/cmd/compile/internal/types2/builtins.go
index 1f7eb23cdf..14be24e251 100644
--- a/src/cmd/compile/internal/types2/builtins.go
+++ b/src/cmd/compile/internal/types2/builtins.go
@@ -802,7 +802,7 @@ func (check *Checker) applyTypeFunc(f func(Type) Type, x Type) Type {
// type param is placed in the current package so export/import
// works as expected.
tpar := NewTypeName(nopos, check.pkg, "<type parameter>", nil)
- ptyp := check.NewTypeParam(tpar, 0, &emptyInterface) // assigns type to tpar as a side-effect
+ ptyp := check.NewTypeParam(tpar, tp.index, &emptyInterface) // assigns type to tpar as a side-effect
tsum := newUnion(rtypes, tildes)
ptyp.bound = &Interface{complete: true, tset: &TypeSet{types: tsum}}