aboutsummaryrefslogtreecommitdiff
path: root/test/typeparam/tparam1.go
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2021-07-15 16:42:25 -0700
committerRobert Griesemer <gri@golang.org>2021-07-16 04:41:47 +0000
commit3d8453e00e3d0a6f23cec06bcad08cf740ec5940 (patch)
tree5ae4ea8833b913919931fcc3d83bda1ee99aa2a2 /test/typeparam/tparam1.go
parent334f2fc045b7d9d846cccba01b3a0dbf70ddb0db (diff)
downloadgo-3d8453e00e3d0a6f23cec06bcad08cf740ec5940.tar.gz
go-3d8453e00e3d0a6f23cec06bcad08cf740ec5940.zip
[dev.typeparams] cmd/compile/internal/types2: more consistent handling of predeclared "any"
Rather than removing "any" from the universe scope, keep it predeclared but provide a better error message. While at it, remove some unnecessary type assertions. Change-Id: I10603274282ea6afc107f703ab194f32bd334dd1 Reviewed-on: https://go-review.googlesource.com/c/go/+/334911 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 'test/typeparam/tparam1.go')
-rw-r--r--test/typeparam/tparam1.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/typeparam/tparam1.go b/test/typeparam/tparam1.go
index 7043933326..2bcc4af3db 100644
--- a/test/typeparam/tparam1.go
+++ b/test/typeparam/tparam1.go
@@ -10,8 +10,8 @@ package tparam1
// The predeclared identifier "any" is only visible as a constraint
// in a type parameter list.
-var _ any // ERROR "undefined"
-func _(_ any) // ERROR "undefined"
+var _ any // ERROR "cannot use any outside constraint position"
+func _(_ any) // ERROR "cannot use any outside constraint position"
type _[_ any /* ok here */ ] struct{}
const N = 10