0
1
mirror of https://github.com/golang/go synced 2025-05-09 03:55:11 +00:00

cmd/compile, go/types: allow any anywhere (as a type)

Adjust types2 and go/types and some test cases.

Because `any` is not treated specially anymore in constraint
position we get additional errors in constraints if `any` is
used before Go1.18 (in addition to the error that type parameter
lists are not permitted before Go1.18).

Fixes .

Change-Id: I85590c6094b07c3e494fef319e3a38d0217cf6f0
Reviewed-on: https://go-review.googlesource.com/c/go/+/351456
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>
This commit is contained in:
Robert Griesemer
2021-09-22 11:26:40 -07:00
parent 7a03ca65b3
commit 1e57748892
14 changed files with 49 additions and 80 deletions
src
test
fixedbugs
typeparam

@ -1,4 +1,4 @@
// errorcheck
// compile
// Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
@ -6,4 +6,5 @@
package p
var x any // ERROR "undefined: any|undefined type .*any.*|cannot use any outside constraint position"
// any is now permitted instead of interface{}
var x any