This is a port of CL 283475 to go/types.
For #43680
Change-Id: Ida630651247a40e28d405594394476e346354866
Reviewed-on: https://go-review.googlesource.com/c/go/+/291321
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
m1(T)
}
+// There is no such thing as a variadic generic type.
+type _[T ... /* ERROR invalid use of ... */ interface{}] struct{}
+
// Generic interfaces may be embedded as one would expect.
type I2 interface {
I1(int) // method!
typ.elem = check.varType(e.Elt)
return typ
+ case *ast.Ellipsis:
+ // dots are handled explicitly where they are legal
+ // (array composite literals and parameter lists)
+ check.error(e, _InvalidDotDotDot, "invalid use of '...'")
+ check.use(e.Elt)
+
case *ast.StructType:
typ := new(Struct)
def.setUnderlying(typ)