• acanino's avatar
    cmd/compile: "invalid variable name x in type switch", where x is a name of a constant · b60c8203
    acanino authored
    Small fix: looks like a short variable declaration with a type switch
    checks to make sure the variable used had valid shape (ONAME, OTYPE, or
    ONONAME) and rejects everything else. Then a new variable is declared.
    If the symbol contained in the declaration was a named OLITERAL (still a
    valid identifier obviously) it would be rejected, even though a new
    variable would have been declared.
    
    Fix adds this case to the check.
    
    Added a test case from issue12413.
    
    Fixes #12413
    
    Change-Id: I150dadafa8ee5612c867d58031027f2dca8c6ebc
    Reviewed-on: https://go-review.googlesource.com/15760Reviewed-by: 's avatarMinux Ma <minux@golang.org>
    Run-TryBot: Minux Ma <minux@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    b60c8203
Name
Last commit
Last update
..
addr2line Loading commit data...
api Loading commit data...
asm Loading commit data...
cgo Loading commit data...
compile Loading commit data...
cover Loading commit data...
dist Loading commit data...
doc Loading commit data...
fix Loading commit data...
go Loading commit data...
gofmt Loading commit data...
internal Loading commit data...
link Loading commit data...
newlink Loading commit data...
nm Loading commit data...
objdump Loading commit data...
pack Loading commit data...
pprof Loading commit data...
trace Loading commit data...
vendor Loading commit data...
vet Loading commit data...
yacc Loading commit data...