]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.20] cmd/compile/internal/noder: stop creating TUNION types
authorMatthew Dempsky <mdempsky@google.com>
Fri, 2 Dec 2022 01:24:23 +0000 (17:24 -0800)
committerDavid Chase <drchase@google.com>
Thu, 9 Feb 2023 18:01:12 +0000 (18:01 +0000)
commit90b06002c44e7fb8fd4b9227efd2d1423e21176b
tree7689152b1ffe1cbc8007990a647eeffcc5551600
parent487be3f90bf65c06eb5f1f30aec30cd0e5b24f92
[release-branch.go1.20] cmd/compile/internal/noder: stop creating TUNION types

In the types1 universe under the unified frontend, we never need to
worry about type parameter constraints, so we only see pure
interfaces. However, we might still see interfaces that contain union
types, because of interfaces like "interface{ any | int }" (equivalent
to just "any").

We can handle these without needing to actually represent type unions
within types1 by simply mapping any union to "any".

Fixes #58413.

Change-Id: I5e4efcf0339edbb01f4035c54fb6fb1f9ddc0c65
Reviewed-on: https://go-review.googlesource.com/c/go/+/458619
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Keith Randall <khr@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
(cherry picked from commit a7de684e1b6f460aae7d4dbf2568cb21130ec520)
Reviewed-on: https://go-review.googlesource.com/c/go/+/466435
Reviewed-by: Than McIntosh <thanm@google.com>
Run-TryBot: David Chase <drchase@google.com>
src/cmd/compile/internal/noder/reader.go
test/typeparam/issue52124.go