From: Matthew Dempsky Date: Sat, 5 Mar 2016 00:39:07 +0000 (-0800) Subject: cmd/compile: stop leaking 'any' type into user package X-Git-Tag: go1.7beta1~1539 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=3da1a26fba32fe65f43ac5226d079224255ada68;p=gostls13.git 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 --- diff --git a/src/cmd/compile/internal/gc/lex.go b/src/cmd/compile/internal/gc/lex.go index 3fa876ad40..81bd9461ca 100644 --- a/src/cmd/compile/internal/gc/lex.go +++ b/src/cmd/compile/internal/gc/lex.go @@ -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) diff --git a/test/fixedbugs/issue14652.go b/test/fixedbugs/issue14652.go new file mode 100644 index 0000000000..b030aee16f --- /dev/null +++ b/test/fixedbugs/issue14652.go @@ -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"