aboutsummaryrefslogtreecommitdiff
path: root/test/typeparam
diff options
context:
space:
mode:
authorMatthew Dempsky <mdempsky@google.com>2022-12-01 17:24:23 -0800
committerMatthew Dempsky <mdempsky@google.com>2023-01-26 21:43:08 +0000
commita7de684e1b6f460aae7d4dbf2568cb21130ec520 (patch)
tree6514c72108634488a7ee3aab15ef8b08fa764838 /test/typeparam
parent627f12868c4c3e714bbb4ce4a418f918c1935dc2 (diff)
downloadgo-a7de684e1b6f460aae7d4dbf2568cb21130ec520.tar.xz
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". Updates #57410. 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>
Diffstat (limited to 'test/typeparam')
-rw-r--r--test/typeparam/issue52124.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/typeparam/issue52124.go b/test/typeparam/issue52124.go
index a113fc7444..07cba47982 100644
--- a/test/typeparam/issue52124.go
+++ b/test/typeparam/issue52124.go
@@ -6,7 +6,9 @@
package p
-type I interface{ any | int }
+type Any any
+
+type I interface{ Any | int }
var (
X I = 42