Open
Description
For example, take this Golang CL: https://go-review.googlesource.com/c/go/+/100455
The func was always called like:
mkinlcall(n, n.Left, n.Isddd())
mkinlcall(n, f, n.Isddd())
etc
Since the func always receives n
, receiving n.Method()
is redundant.
Other redundant cases that come to mind, when a func receives x
:
x.Field
x[i]
x[i:j]
*x
And of course, any combination of the above.
I'm leaving x.PureMethod()
and PureFunc(x)
out of the list as that's a much more complex one - we'd have to figure out that the func has no side effects. I don't think SSA does this just yet.
Metadata
Metadata
Assignees
Labels
No labels