Fix: issue 4188 UnsolvedSymbolException resolving MethocCallExpr using MethodReferenceExpr#4931
Merged
jlerbsc merged 1 commit intojavaparser:masterfrom Dec 19, 2025
Merged
Conversation
…g MethodReferenceExpr
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #4931 +/- ##
===============================================
- Coverage 58.445% 58.444% -0.002%
- Complexity 2560 2561 +1
===============================================
Files 689 689
Lines 39553 39566 +13
Branches 7176 7182 +6
===============================================
+ Hits 23117 23124 +7
Misses 13497 13497
- Partials 2939 2945 +6
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 6 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4188 .
This PR improves the resolution of a reference expression of the form Primary, followed by :: and a method name.".
JLS §15.13.1: "If the method reference expression has the form Primary :: [TypeArguments] Identifier"
This is FORM 2: The scope is an expression (e.g., foo, myString, System.out)
CRITICAL: In this form, the expression is evaluated and becomes the BOUND RECEIVER at method reference creation time, not at invocation time.
The potentially applicable methods are the member methods of the type of the Primary that are not static
For bound instance methods: ALL functional interface parameters map to method parameters
The receiver is NOT part of paramTypes - it's already bound to the expression result
Example from failing test:
Analysis: