]> Cypherpunks repositories - gostls13.git/commitdiff
go/types, types2: re-enable a couple of commented out tests
authorRobert Griesemer <gri@golang.org>
Thu, 30 Jun 2022 01:21:32 +0000 (18:21 -0700)
committerRobert Griesemer <gri@google.com>
Thu, 30 Jun 2022 23:25:23 +0000 (23:25 +0000)
Change-Id: Ibb27012b18fc0f0f9f9ef74cc120e7ef981e6d43
Reviewed-on: https://go-review.googlesource.com/c/go/+/415156
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Run-TryBot: Robert Griesemer <gri@google.com>

src/cmd/compile/internal/types2/testdata/fixedbugs/issue39634.go
src/go/types/testdata/fixedbugs/issue39634.go

index b408dd70039597ffa468bbf91419f4e123d25e21..b7d99f96c2f5fc19a566f39f5877e7a6034f634e 100644 (file)
@@ -31,10 +31,8 @@ type x7[A any] struct{ foo7 }
 func main7() { var _ foo7 = x7[int]{} }
 
 // crash 8
-// Embedding stand-alone type parameters is not permitted for now. Disabled.
-// type foo8[A any] interface { ~A }
-// func bar8[A foo8[A]](a A) {}
-// func main8() {}
+type foo8[A any] interface { ~A /* ERROR cannot be a type parameter */ }
+func bar8[A foo8[A]](a A) {}
 
 // crash 9
 type foo9[A any] interface { foo9 /* ERROR illegal cycle */ [A] }
@@ -74,10 +72,9 @@ func F20[t Z20]() { F20(t /* ERROR invalid composite literal type */ {}) }
 type Z21 /* ERROR illegal cycle */ interface{ Z21 }
 func F21[T Z21]() { ( /* ERROR not used */ F21[Z21]) }
 
-// For now, a lone type parameter is not permitted as RHS in a type declaration (issue #45639).
-// // crash 24
-// type T24[P any] P
-// func (r T24[P]) m() { T24 /* ERROR without instantiation */ .m() }
+// crash 24
+type T24[P any] P // ERROR cannot use a type parameter as RHS in type declaration
+func (r T24[P]) m() { T24 /* ERROR without instantiation */ .m() }
 
 // crash 25
 type T25[A any] int
index 8cba2e735a00d8848e98157fd06ca8c969f15334..ce84299a6159bc3934401211f6d7ef0a880f65a4 100644 (file)
@@ -31,10 +31,8 @@ type x7[A any] struct{ foo7 }
 func main7() { var _ foo7 = x7[int]{} }
 
 // crash 8
-// Embedding stand-alone type parameters is not permitted for now. Disabled.
-// type foo8[A any] interface { ~A }
-// func bar8[A foo8[A]](a A) {}
-// func main8() {}
+type foo8[A any] interface { ~A /* ERROR cannot be a type parameter */ }
+func bar8[A foo8[A]](a A) {}
 
 // crash 9
 type foo9[A any] interface { foo9 /* ERROR illegal cycle */ [A] }
@@ -74,10 +72,9 @@ func F20[t Z20]() { F20(t /* ERROR invalid composite literal type */ {}) }
 type Z21 /* ERROR illegal cycle */ interface{ Z21 }
 func F21[T Z21]() { ( /* ERROR not used */ F21[Z21]) }
 
-// For now, a lone type parameter is not permitted as RHS in a type declaration (issue #45639).
-// // crash 24
-// type T24[P any] P
-// func (r T24[P]) m() { T24 /* ERROR without instantiation */ .m() }
+// crash 24
+type T24[P any] P // ERROR cannot use a type parameter as RHS in type declaration
+func (r T24[P]) m() { T24 /* ERROR without instantiation */ .m() }
 
 // crash 25
 type T25[A any] int