]> Cypherpunks repositories - gostls13.git/commit
types2, go/types: fix instantiation of named type with generic alias
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 13:41:08 +0000 (13:41 +0000)
commit9b4b4ae5859393993ec1a2359666a9c49d0d5b73
tree16c736810a392ae8e43c6884c644421feebc82ae
parentd8c7230c97ca5639389917cc235175bfe2dc50ab
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>
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]