]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.23] types2, go/types: fix instantiation of named type with generi...
authorCuong Manh Le <cuong.manhle.vn@gmail.com>
Thu, 25 Jul 2024 10:17:44 +0000 (17:17 +0700)
committerGopher Robot <gobot@golang.org>
Fri, 26 Jul 2024 16:35:29 +0000 (16:35 +0000)
commitc9940fe2a9f2eb77327efca860abfbae8d94bf28
tree466a7485cbda3bda94c0cc015e7d0acb0ab8ee23
parent3509415eca0eac695c706eaf63cb4c8d8d69b7f2
[release-branch.go1.23] types2, go/types: fix instantiation of named type with generic alias

The typechecker is assuming that alias instances cannot be reached from
a named type. However, when type parameters on aliases are permited, it
can happen.

This CL changes the typechecker to propagate the correct named instance
is being expanded.

Updates #46477
Fixes #68580

Change-Id: Id0879021f4640c0fefe277701d5096c649413811
Reviewed-on: https://go-review.googlesource.com/c/go/+/601115
Auto-Submit: Robert Griesemer <gri@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/601116
src/cmd/compile/internal/types2/alias.go
src/cmd/compile/internal/types2/instantiate.go
src/cmd/compile/internal/types2/subst.go
src/go/types/alias.go
src/go/types/instantiate.go
src/go/types/subst.go
test/fixedbugs/issue68580.go [new file with mode: 0644]