aboutsummaryrefslogtreecommitdiff
path: root/src/go/types/testdata/fixedbugs/issue39693.go2
diff options
context:
space:
mode:
Diffstat (limited to 'src/go/types/testdata/fixedbugs/issue39693.go2')
-rw-r--r--src/go/types/testdata/fixedbugs/issue39693.go217
1 files changed, 13 insertions, 4 deletions
diff --git a/src/go/types/testdata/fixedbugs/issue39693.go2 b/src/go/types/testdata/fixedbugs/issue39693.go2
index 316ab1982e..ec7641902a 100644
--- a/src/go/types/testdata/fixedbugs/issue39693.go2
+++ b/src/go/types/testdata/fixedbugs/issue39693.go2
@@ -4,11 +4,20 @@
package p
-type Number interface {
- int /* ERROR int is not an interface */
- float64 /* ERROR float64 is not an interface */
+type Number1 interface {
+ // embedding non-interface types is permitted
+ int
+ float64
}
-func Add[T Number](a, b T) T {
+func Add[T Number1](a, b T) T {
return a /* ERROR not defined */ + b
}
+
+type Number2 interface {
+ int|float64
+}
+
+func Add2[T Number2](a, b T) T {
+ return a + b
+}