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 #33232. 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:
src
cmd
compile
internal
types2
go
types
test
@ -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
|
||||
|
Reference in New Issue
Block a user