• 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
..
all Loading commit data...
internal Loading commit data...
testdata Loading commit data...
README Loading commit data...
asmdecl.go Loading commit data...
assign.go Loading commit data...
atomic.go Loading commit data...
bool.go Loading commit data...
buildtag.go Loading commit data...
cgo.go Loading commit data...
composite.go Loading commit data...
copylock.go Loading commit data...
dead.go Loading commit data...
deadcode.go Loading commit data...
doc.go Loading commit data...
httpresponse.go Loading commit data...
lostcancel.go Loading commit data...
main.go Loading commit data...
method.go Loading commit data...
nilfunc.go Loading commit data...
print.go Loading commit data...
rangeloop.go Loading commit data...
shadow.go Loading commit data...
shift.go Loading commit data...
structtag.go Loading commit data...
tests.go Loading commit data...
types.go Loading commit data...
unsafeptr.go Loading commit data...
unused.go Loading commit data...
vet_test.go Loading commit data...