Repository navigation
GROOVY-12748: STC: keep the parameter count of an implicit-parameter … - #3282
Open
paulk-asert wants to merge 1 commit into
Open
paulk-asert wants to merge 1 commit into
paulk-asert wants to merge 1 commit into
Conversation
…closure when its call is checked again A closure with an implicit parameter passed to a method overloaded on functional interfaces that take different numbers of parameters, such as Function and BinaryOperator, was matched to the interface taking none or one parameter (GROOVY-10905) the first time the call was type checked, from the parameter count the closure's type carries. Visiting the closure stored its inferred type without that count, so when the call was checked again, as the body of a loop or closure in which a variable changes type is, or while looking for a property after a method was not found on the call's result, the overloads were at the same distance and the call was reported as ambiguous. The stored type now carries the parameter count too.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3282 +/- ##
==================================================
- Coverage 74.4215% 74.4125% -0.0091%
+ Complexity 44470 44466 -4
==================================================
Files 1699 1699
Lines 151307 151308 +1
Branches 28867 28866 -1
==================================================
- Hits 112605 112592 -13
- Misses 28394 28403 +9
- Partials 10308 10313 +5
🚀 New features to boost your workflow:
|
✅ All tests passed ✅🏷️ Commit: 85ed265 Learn more about TestLens at testlens.app/docs. |
This branch has not been deployed
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.
…closure when its call is checked again
A closure with an implicit parameter passed to a method overloaded on functional interfaces that take different numbers of parameters, such as Function and BinaryOperator, was matched to the interface taking none or one parameter (GROOVY-10905) the first time the call was type checked, from the parameter count the closure's type carries. Visiting the closure stored its inferred type without that count, so when the call was checked again, as the body of a loop or closure in which a variable changes type is, or while looking for a property after a method was not found on the call's result, the overloads were at the same distance and the call was reported as ambiguous. The stored type now carries the parameter count too.