]> Cypherpunks repositories - gostls13.git/commit
go/types: fix bug in premature Unalias of alias cycle
authorAlan Donovan <adonovan@google.com>
Fri, 5 Apr 2024 20:51:28 +0000 (16:51 -0400)
committerGopher Robot <gobot@golang.org>
Fri, 5 Apr 2024 22:09:57 +0000 (22:09 +0000)
commitd186dde81844badfa961f8af5044136dce8dc39e
treeec01103a2b1846725cfa5f165106108eaacb323b
parent5ec7395afc5756e9334f969fcc8b538c83857634
go/types: fix bug in premature Unalias of alias cycle

Unalias memoizes the result of removing Alias constructors.
When Unalias is called too soon on a type in a cycle,
the initial value of the alias, Invalid, gets latched by
the memoization, causing it to appear Invalid forever.

This change disables memoization of Invalid, and adds
a regression test.

Fixes #66704
Updates #65294

Change-Id: I479fe14c88c802504a69f177869f091656489cd4
Reviewed-on: https://go-review.googlesource.com/c/go/+/576975
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Auto-Submit: Alan Donovan <adonovan@google.com>
src/cmd/compile/internal/types2/alias.go
src/go/types/alias.go
src/go/types/api_test.go
src/go/types/decl.go