• 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
.github Loading commit data...
api Loading commit data...
doc Loading commit data...
lib/time Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTING.md Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README.md Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...