aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/types2/testdata
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2021-06-02 15:45:43 -0700
committerRobert Griesemer <gri@golang.org>2021-06-02 23:19:31 +0000
commitc790964ae457f244e634184a810b226b27bf7e0b (patch)
treefede3be3ca9941fd7590367468440b222860cac6 /src/cmd/compile/internal/types2/testdata
parent9a99e728fecccb992a175f9d39c5c64d78d429fc (diff)
downloadgo-c790964ae457f244e634184a810b226b27bf7e0b.tar.gz
go-c790964ae457f244e634184a810b226b27bf7e0b.zip
[dev.typeparams] cmd/compile/internal/types2: convert testdata/fixedbugs tests to type set sytax
Change-Id: I2ad94c71bebb93e0e3f4eba9d5199a3b3e9fa63d Reviewed-on: https://go-review.googlesource.com/c/go/+/324530 Trust: Robert Griesemer <gri@golang.org> Run-TryBot: Robert Griesemer <gri@golang.org> Reviewed-by: Robert Findley <rfindley@google.com>
Diffstat (limited to 'src/cmd/compile/internal/types2/testdata')
-rw-r--r--src/cmd/compile/internal/types2/testdata/fixedbugs/issue39634.go24
-rw-r--r--src/cmd/compile/internal/types2/testdata/fixedbugs/issue39680.go24
-rw-r--r--src/cmd/compile/internal/types2/testdata/fixedbugs/issue39699.go22
-rw-r--r--src/cmd/compile/internal/types2/testdata/fixedbugs/issue39723.go22
-rw-r--r--src/cmd/compile/internal/types2/testdata/fixedbugs/issue39755.go24
-rw-r--r--src/cmd/compile/internal/types2/testdata/fixedbugs/issue41124.go24
-rw-r--r--src/cmd/compile/internal/types2/testdata/fixedbugs/issue42758.go22
-rw-r--r--src/cmd/compile/internal/types2/testdata/fixedbugs/issue45548.go22
-rw-r--r--src/cmd/compile/internal/types2/testdata/fixedbugs/issue45635.go22
-rw-r--r--src/cmd/compile/internal/types2/testdata/fixedbugs/issue45985.go22
10 files changed, 14 insertions, 14 deletions
diff --git a/src/cmd/compile/internal/types2/testdata/fixedbugs/issue39634.go2 b/src/cmd/compile/internal/types2/testdata/fixedbugs/issue39634.go2
index 92ea305479..39ec5d7b30 100644
--- a/src/cmd/compile/internal/types2/testdata/fixedbugs/issue39634.go2
+++ b/src/cmd/compile/internal/types2/testdata/fixedbugs/issue39634.go2
@@ -31,12 +31,12 @@ type x7[A any] struct{ foo7 }
func main7() { var _ foo7 = x7[int]{} }
// crash 8
-type foo8[A any] interface { type A }
+type foo8[A any] interface { ~A }
func bar8[A foo8[A]](a A) {}
func main8() {}
// crash 9
-type foo9[A any] interface { type foo9 /* ERROR cannot use interface */ [A] }
+type foo9[A any] interface { ~/* ERROR cannot use interface */ foo9[A] }
func _() { var _ = new(foo9 /* ERROR interface contains type constraints */ [int]) }
// crash 12
diff --git a/src/cmd/compile/internal/types2/testdata/fixedbugs/issue39680.go2 b/src/cmd/compile/internal/types2/testdata/fixedbugs/issue39680.go2
index 9bc26f3546..01eadd2dbf 100644
--- a/src/cmd/compile/internal/types2/testdata/fixedbugs/issue39680.go2
+++ b/src/cmd/compile/internal/types2/testdata/fixedbugs/issue39680.go2
@@ -7,13 +7,13 @@ package p
import "fmt"
// Minimal test case.
-func _[T interface{type T}](x T) T{
+func _[T interface{~T}](x T) T{
return x
}
// Test case from issue.
type constr[T any] interface {
- type T
+ ~T
}
func Print[T constr[T]](s []T) {
diff --git a/src/cmd/compile/internal/types2/testdata/fixedbugs/issue39699.go2 b/src/cmd/compile/internal/types2/testdata/fixedbugs/issue39699.go2
index 75491e7e26..72f83997c2 100644
--- a/src/cmd/compile/internal/types2/testdata/fixedbugs/issue39699.go2
+++ b/src/cmd/compile/internal/types2/testdata/fixedbugs/issue39699.go2
@@ -8,7 +8,7 @@ type T0 interface{
}
type T1 interface{
- type int
+ ~int
}
type T2 interface{
diff --git a/src/cmd/compile/internal/types2/testdata/fixedbugs/issue39723.go2 b/src/cmd/compile/internal/types2/testdata/fixedbugs/issue39723.go2
index 61bc606789..367b3f1360 100644
--- a/src/cmd/compile/internal/types2/testdata/fixedbugs/issue39723.go2
+++ b/src/cmd/compile/internal/types2/testdata/fixedbugs/issue39723.go2
@@ -6,4 +6,4 @@ package p
// A constraint must be an interface; it cannot
// be a type parameter, for instance.
-func _[A interface{ type int }, B A /* ERROR not an interface */ ]()
+func _[A interface{ ~int }, B A /* ERROR not an interface */ ]()
diff --git a/src/cmd/compile/internal/types2/testdata/fixedbugs/issue39755.go2 b/src/cmd/compile/internal/types2/testdata/fixedbugs/issue39755.go2
index b7ab68818e..257b73a2fb 100644
--- a/src/cmd/compile/internal/types2/testdata/fixedbugs/issue39755.go2
+++ b/src/cmd/compile/internal/types2/testdata/fixedbugs/issue39755.go2
@@ -4,14 +4,14 @@
package p
-func _[T interface{type map[string]int}](x T) {
+func _[T interface{~map[string]int}](x T) {
_ = x == nil
}
// simplified test case from issue
type PathParamsConstraint interface {
- type map[string]string, []struct{key, value string}
+ ~map[string]string | ~[]struct{key, value string}
}
type PathParams[T PathParamsConstraint] struct {
diff --git a/src/cmd/compile/internal/types2/testdata/fixedbugs/issue41124.go2 b/src/cmd/compile/internal/types2/testdata/fixedbugs/issue41124.go2
index 61f766bcbd..ab535049dd 100644
--- a/src/cmd/compile/internal/types2/testdata/fixedbugs/issue41124.go2
+++ b/src/cmd/compile/internal/types2/testdata/fixedbugs/issue41124.go2
@@ -7,7 +7,7 @@ package p
// Test case from issue.
type Nat interface {
- type Zero, Succ
+ Zero|Succ
}
type Zero struct{}
@@ -22,7 +22,7 @@ type I1 interface {
}
type I2 interface {
- type int
+ ~int
}
type I3 interface {
diff --git a/src/cmd/compile/internal/types2/testdata/fixedbugs/issue42758.go2 b/src/cmd/compile/internal/types2/testdata/fixedbugs/issue42758.go2
index 698cb8a16b..bf0031f5d2 100644
--- a/src/cmd/compile/internal/types2/testdata/fixedbugs/issue42758.go2
+++ b/src/cmd/compile/internal/types2/testdata/fixedbugs/issue42758.go2
@@ -17,7 +17,7 @@ func _[T any](x interface{}){
}
type constraint interface {
- type int
+ ~int
}
func _[T constraint](x interface{}){
diff --git a/src/cmd/compile/internal/types2/testdata/fixedbugs/issue45548.go2 b/src/cmd/compile/internal/types2/testdata/fixedbugs/issue45548.go2
index b1e42497e8..b8ba0ad4a7 100644
--- a/src/cmd/compile/internal/types2/testdata/fixedbugs/issue45548.go2
+++ b/src/cmd/compile/internal/types2/testdata/fixedbugs/issue45548.go2
@@ -4,7 +4,7 @@
package p
-func f[F interface{type *Q}, G interface{type *R}, Q, R any](q Q, r R) {}
+func f[F interface{~*Q}, G interface{~*R}, Q, R any](q Q, r R) {}
func _() {
f[*float64, *int](1, 2)
diff --git a/src/cmd/compile/internal/types2/testdata/fixedbugs/issue45635.go2 b/src/cmd/compile/internal/types2/testdata/fixedbugs/issue45635.go2
index 65662cdc76..e9b57ae8f1 100644
--- a/src/cmd/compile/internal/types2/testdata/fixedbugs/issue45635.go2
+++ b/src/cmd/compile/internal/types2/testdata/fixedbugs/issue45635.go2
@@ -13,7 +13,7 @@ type N[T any] struct{}
var _ N[] /* ERROR expecting type */
type I interface {
- type map[int]int, []int
+ ~map[int]int | ~[]int
}
func _[T I](i, j int) {
diff --git a/src/cmd/compile/internal/types2/testdata/fixedbugs/issue45985.go2 b/src/cmd/compile/internal/types2/testdata/fixedbugs/issue45985.go2
index 7678e348ef..f25b9d2b26 100644
--- a/src/cmd/compile/internal/types2/testdata/fixedbugs/issue45985.go2
+++ b/src/cmd/compile/internal/types2/testdata/fixedbugs/issue45985.go2
@@ -5,7 +5,7 @@
package issue45985
// TODO(gri): this error should be on app[int] below.
-func app[S /* ERROR "type S = S does not match" */ interface{ type []T }, T any](s S, e T) S {
+func app[S /* ERROR "type S = S does not match" */ interface{ ~[]T }, T any](s S, e T) S {
return append(s, e)
}