Skip to content

Go: Fix missing flow through receiver for function variable (try 2) #13861

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

owen-mc
Copy link
Contributor

@owen-mc owen-mc commented Aug 1, 2023

Reinstate #13767 (reverted here). Based on #13785 which fixes golangSpecificParamArgFilter in a better way which doesn't ruin performance.

When assigning a method to a function variable (f := a.b) and calling it using the variable (f(arg1, arg2)), we were losing any possible flow to the receiver of the method.

@owen-mc owen-mc requested a review from a team as a code owner August 1, 2023 06:49
smowton
smowton previously approved these changes Aug 1, 2023
Copy link
Contributor

@smowton smowton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Except the comment fix noted in the smaller PR

@owen-mc owen-mc dismissed smowton’s stale review August 2, 2023 14:40

The merge-base changed after approval.

@owen-mc owen-mc force-pushed the go/missing-flow-through-receiver-2 branch from d63909e to 39c7baa Compare August 2, 2023 16:10
@owen-mc
Copy link
Contributor Author

owen-mc commented Aug 9, 2023

Performance testing showed severe problems. I'm putting this into draft until I've had a chance to fix that.

@owen-mc owen-mc marked this pull request as draft August 9, 2023 23:42
When a function is assigned to a variable and called through that
variable then we can't always tell it wis a method. With
this change we try use local flow to determine if the function being
called is a method.
This is not required, because getReceiver is still defined on CallNode,
but is done for consistency.
@owen-mc owen-mc force-pushed the go/missing-flow-through-receiver-2 branch from 39c7baa to e91b7f0 Compare November 22, 2023 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants