]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: fix ICE with recursive alias type parameter
authorCuong Manh Le <cuong.manhle.vn@gmail.com>
Fri, 25 Apr 2025 12:13:52 +0000 (19:13 +0700)
committerGopher Robot <gobot@golang.org>
Thu, 22 May 2025 18:23:35 +0000 (11:23 -0700)
commitb1f259b1b42f055863a67492e7815ec752eae56b
treeb750114613862a7dd71807a7b4fd3a14841e17e5
parent155ba387a93fddbd6ced288fe539a55c31b2597e
cmd/compile: fix ICE with recursive alias type parameter

CL 585399 fixed an initialization loop during IR contruction that
involving alias type, by avoiding publishing alias declarations until
the RHS type expression has been constructed.

There's an assertion to ensure that the alias's type must be the same
during the initialization. However, that assertion is too strict, since
we may construct different instances of the same type, if the type is an
instantination of generic type.

To fix this, we could use types.IdenticalStrict to ensure that these
types matching exactly.

Updates #66873.
Updates #73309.

Change-Id: I2559bed37e21615854333fb1057d7349406e6a1b
Reviewed-on: https://go-review.googlesource.com/c/go/+/668175
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@google.com>
src/cmd/compile/internal/noder/reader.go
src/cmd/compile/internal/types2/stdlib_test.go
src/go/types/stdlib_test.go
test/fixedbugs/issue73309.go [new file with mode: 0644]