mirror of
https://github.com/golang/go
synced 2024-10-02 22:25:08 +00:00
go/types, types2: re-enable a couple of commented out tests
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>
This commit is contained in:
parent
aad9382e59
commit
405c269b85
|
@ -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
|
||||
|
|
13
src/go/types/testdata/fixedbugs/issue39634.go
vendored
13
src/go/types/testdata/fixedbugs/issue39634.go
vendored
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue