Skip to content
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

[javasrc2cpg] Fix record accessor call receiver in pattern matches #5301

Merged
merged 1 commit into from
Feb 10, 2025

Conversation

johannescoetzee
Copy link
Contributor

When pattern matching on, for example, a record Foo(String value){}, the field accessor call Foo foo; foo.value() was being created with foo as an argument and not a receiver which, in turn, breaks dataflows. This PR fixes this. I only updated one unit test to demonstrate this, but will use X.receiver consistently when redoing the unit tests for the new pattern variable initialization representation.

@johannescoetzee johannescoetzee requested a review from ml86 February 10, 2025 12:59
@johannescoetzee johannescoetzee merged commit f84df89 into master Feb 10, 2025
5 checks passed
@johannescoetzee johannescoetzee deleted the johannes/javasrc2cpg/pattern-receiver-fix branch February 10, 2025 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants