Fixes #48083.
Change-Id: I77899d3e6edc806dee770403b3c3c4e2974d0e50
Reviewed-on: https://go-review.googlesource.com/c/go/+/346293
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
--- /dev/null
+// Copyright 2021 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package p
+
+type T[P any] struct{}
+
+type _ interface{ int | T /* ERROR cannot use generic type */ }
\ No newline at end of file
x = op.X
tilde = true
}
- typ = check.anyType(x)
+ typ = check.typ(x)
// embedding stand-alone type parameters is not permitted (issue #47127).
if _, ok := under(typ).(*TypeParam); ok {
check.error(x, "cannot embed a type parameter")
--- /dev/null
+// Copyright 2021 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package p
+
+type T[P any] struct{}
+
+type _ interface{ int | T /* ERROR cannot use generic type */ }
\ No newline at end of file
x = op.X
tilde = true
}
- typ = check.anyType(x)
+ typ = check.typ(x)
// embedding stand-alone type parameters is not permitted (issue #47127).
if _, ok := under(typ).(*TypeParam); ok {
check.error(x, _Todo, "cannot embed a type parameter")