• Daniel Martí's avatar
    cmd/vet: recognise func type conversions · 3fbfc83d
    Daniel Martí authored
    In hasSideEffects, vet has to be taught whether or not a CallExpr is an
    actual function call, or just a type conversion.
    
    The previous code knew how to differentiate fn(arg) from int(arg), but
    it incorrectly saw (func(T))(fn) as a func call. This edge case is
    slightly tricky, since the CallExpr.Fun has a func signature type, just
    like in func calls.
    
    However, the difference is that in this case the Fun is a type, not a
    value. This information is in types.TypeAndValue, so use it.
    
    Change-Id: I18bb8b23abbe7decc558b726ff2dc31fae2f13d6
    Reviewed-on: https://go-review.googlesource.com/111416
    Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarRobert Griesemer <gri@golang.org>
    3fbfc83d
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...