aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/types2/testdata/check
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2021-06-02 17:05:37 -0700
committerRobert Griesemer <gri@golang.org>2021-06-03 03:55:37 +0000
commit10d6b36ca3f8d48a667742eee791dacbcfc888cd (patch)
tree019780ec6161df9fe256962e9cdf0c711a493bca /src/cmd/compile/internal/types2/testdata/check
parent8cdce85bdf80f6aa9bd3979d3ecab6565512b736 (diff)
downloadgo-10d6b36ca3f8d48a667742eee791dacbcfc888cd.tar.gz
go-10d6b36ca3f8d48a667742eee791dacbcfc888cd.zip
[dev.typeparams] cmd/compile/internal/types2: disallow ~T where T is a defined type or an interface
Change-Id: I35f6f43db00d56847da48320308f2fcfff924738 Reviewed-on: https://go-review.googlesource.com/c/go/+/324570 Trust: Robert Griesemer <gri@golang.org> Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Robert Findley <rfindley@google.com>
Diffstat (limited to 'src/cmd/compile/internal/types2/testdata/check')
-rw-r--r--src/cmd/compile/internal/types2/testdata/check/typeinst2.go24
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cmd/compile/internal/types2/testdata/check/typeinst2.go2 b/src/cmd/compile/internal/types2/testdata/check/typeinst2.go2
index 37745dfcba..14d8f0ea8c 100644
--- a/src/cmd/compile/internal/types2/testdata/check/typeinst2.go2
+++ b/src/cmd/compile/internal/types2/testdata/check/typeinst2.go2
@@ -176,12 +176,12 @@ type _ interface {
// Interface type lists can contain any type, incl. *Named types.
// Verify that we use the underlying type to compute the operational type.
type MyInt int
-func add1[T interface{~MyInt}](x T) T {
+func add1[T interface{MyInt}](x T) T {
return x + 1
}
type MyString string
-func double[T interface{~MyInt | ~MyString}](x T) T {
+func double[T interface{MyInt|MyString}](x T) T {
return x + x
}