• smasher164's avatar
    cmd/compile: improve error message for non-final variadic parameter · a7af4743
    smasher164 authored
    Previously, when a function signature had defined a non-final variadic
    parameter, the error message always referred to the type associated with that
    parameter. However, if the offending parameter's name was part of an identifier
    list with a variadic type, one could misinterpret the message, thinking the
    problem had been with one of the other names in the identifer list.
    
        func bar(a, b ...int) {}
    clear ~~~~~~~^       ^~~~~~~~ confusing
    
    This change updates the error message and sets the column position to that of
    the offending parameter's name, if it exists.
    
    Fixes #28450.
    
    Change-Id: I076f560925598ed90e218c25d70f9449ffd9b3ea
    Reviewed-on: https://go-review.googlesource.com/c/152417
    Run-TryBot: Matthew Dempsky <mdempsky@google.com>
    Reviewed-by: 's avatarRobert Griesemer <gri@golang.org>
    a7af4743
Name
Last commit
Last update
..
addr2line Loading commit data...
api Loading commit data...
asm Loading commit data...
buildid 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...
nm Loading commit data...
objdump Loading commit data...
pack Loading commit data...
pprof Loading commit data...
test2json Loading commit data...
trace Loading commit data...
vendor Loading commit data...
vet Loading commit data...