mirror of
https://github.com/golang/go
synced 2024-11-05 18:36:08 +00:00
cmd/compile: stop leaking 'any' type into user package
The new check corresponds to the (etype != TANY || Debug['A'] != 0) that was lost in golang.org/cl/19936. Fixes #14652. Change-Id: Iec3788ff02529b3b0f0d4dd92ec9f3ef20aec849 Reviewed-on: https://go-review.googlesource.com/20271 Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
parent
dafbcf6df7
commit
3da1a26fba
2 changed files with 10 additions and 1 deletions
|
@ -2264,7 +2264,7 @@ func lexinit1() {
|
|||
|
||||
func lexfini() {
|
||||
for _, s := range builtinpkg.Syms {
|
||||
if s.Def == nil {
|
||||
if s.Def == nil || (s.Name == "any" && Debug['A'] == 0) {
|
||||
continue
|
||||
}
|
||||
s1 := Lookup(s.Name)
|
||||
|
|
9
test/fixedbugs/issue14652.go
Normal file
9
test/fixedbugs/issue14652.go
Normal file
|
@ -0,0 +1,9 @@
|
|||
// errorcheck
|
||||
|
||||
// Copyright 2016 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package p
|
||||
|
||||
var x any // ERROR "undefined: any"
|
Loading…
Reference in a new issue