aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/types2/testdata/examples
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2021-06-02 17:50:47 -0700
committerRobert Griesemer <gri@golang.org>2021-06-03 03:55:44 +0000
commit95c618e99a3f733543fd36ef19e833d04acc8710 (patch)
tree2c372a61f2aa460769c1b7bdac644e29aa4433dc /src/cmd/compile/internal/types2/testdata/examples
parent10d6b36ca3f8d48a667742eee791dacbcfc888cd (diff)
downloadgo-95c618e99a3f733543fd36ef19e833d04acc8710.tar.gz
go-95c618e99a3f733543fd36ef19e833d04acc8710.zip
[dev.typeparams] cmd/compile/internal/types2: add Config.AllowTypeLists to control type list handling
Eventually the flag should not be set anymore, but we set it in the compiler until all tests have been converted. Also, convert some more types2 tests to use the type set notation. Change-Id: I616599a3473451ab75d67272016b2bd3de6835af Reviewed-on: https://go-review.googlesource.com/c/go/+/324571 Trust: Robert Griesemer <gri@golang.org> Reviewed-by: Robert Findley <rfindley@google.com>
Diffstat (limited to 'src/cmd/compile/internal/types2/testdata/examples')
-rw-r--r--src/cmd/compile/internal/types2/testdata/examples/constraints.go212
1 files changed, 12 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/types2/testdata/examples/constraints.go2 b/src/cmd/compile/internal/types2/testdata/examples/constraints.go2
index efefaa2a25..d9805fe694 100644
--- a/src/cmd/compile/internal/types2/testdata/examples/constraints.go2
+++ b/src/cmd/compile/internal/types2/testdata/examples/constraints.go2
@@ -7,6 +7,18 @@
package p
type (
+ // Type lists are processed as unions but an error is reported.
+ // TODO(gri) remove this once the parser doesn't accept type lists anymore.
+ _ interface{
+ type /* ERROR use generalized embedding syntax instead of a type list */ int
+ }
+ _ interface{
+ type /* ERROR use generalized embedding syntax instead of a type list */ int
+ type float32
+ }
+)
+
+type (
// Arbitrary types may be embedded like interfaces.
_ interface{int}
_ interface{~int}