aboutsummaryrefslogtreecommitdiff
path: root/test/codegen
diff options
context:
space:
mode:
Diffstat (limited to 'test/codegen')
-rw-r--r--test/codegen/typeswitch.go22
1 files changed, 21 insertions, 1 deletions
diff --git a/test/codegen/typeswitch.go b/test/codegen/typeswitch.go
index 495853ed3c..93f8e84269 100644
--- a/test/codegen/typeswitch.go
+++ b/test/codegen/typeswitch.go
@@ -37,11 +37,31 @@ func swGYZ[T any](a Ig[T]) {
t.Y()
case Iz: // amd64:-".*typeAssert"
t.Z()
- case interface{ G() T }: // amd64:-".*typeAssert",".*assertE2I"
+ case interface{ G() T }: // amd64:-".*typeAssert",-".*assertE2I\\(",".*assertE2I2"
+ t.G()
+ }
+}
+
+func swE2G[T any](a any) {
+ switch t := a.(type) {
+ case Iy:
+ t.Y()
+ case Ig[T]: // amd64:-".*assertE2I\\(",".*assertE2I2"
+ t.G()
+ }
+}
+
+func swI2G[T any](a Ix) {
+ switch t := a.(type) {
+ case Iy:
+ t.Y()
+ case Ig[T]: // amd64:-".*assertE2I\\(",".*assertE2I2"
t.G()
}
}
func swCaller() {
swGYZ[int]((Ig[int])(nil))
+ swE2G[int]((Ig[int])(nil))
+ swI2G[int]((Ix)(nil))
}