]> Cypherpunks repositories - gostls13.git/commit
go/types, types2: add missing Unalias calls in type unifier
authorRobert Griesemer <gri@golang.org>
Tue, 11 Jun 2024 15:57:37 +0000 (08:57 -0700)
committerGopher Robot <gobot@golang.org>
Tue, 11 Jun 2024 16:24:39 +0000 (16:24 +0000)
commit0d478d8e07f9667d7c32ea5bb10647dd14725829
tree9d80c1bf6f7143a290f5bb072db84fe86aa4a0a1
parentbeaf7f3282c2548267d3c894417cc4ecacc5d575
go/types, types2: add missing Unalias calls in type unifier

The unification code has "early exits" when the compared
types are pointer-identical.

Because of Alias nodes, we cannot simply compare x == y but we
must compare Unalias(x) == Unalias(y). Still, in the common case
there are no aliases, so as a minor optimization we write:

        x == y || Unalias(x) == Unalias(y)

to test whether x and y are (pointer-) identical.
Add the missing Unalias calls in the place where we forgot them.

Fixes #67872.

Change-Id: Ia26ffe7205b0417fc698287a4aeb1c900d30cc0d
Reviewed-on: https://go-review.googlesource.com/c/go/+/591975
Reviewed-by: Robert Findley <rfindley@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Griesemer <gri@google.com>
src/cmd/compile/internal/types2/unify.go
src/go/types/unify.go
src/internal/types/testdata/fixedbugs/issue67872.go [new file with mode: 0644]