G
YouTube TikTok Games
Skip to content

GROOVY-12748: STC: keep the parameter count of an implicit-parameter … - #3282

Open
paulk-asert wants to merge 1 commit into
apache:masterfrom
paulk-asert:groovy12748
Open

paulk-asert wants to merge 1 commit into
apache:masterfrom
paulk-asert:groovy12748

Conversation

@paulk-asert

Copy link
Copy Markdown
Contributor

…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.

…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-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.4125%. Comparing base (bef476a) to head (85ed265).

Additional details and impacted files

Impacted file tree graph

@@                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     
Files with missing lines Coverage Δ
...roovy/transform/stc/StaticTypeCheckingVisitor.java 88.0521% <100.0000%> (+0.0024%) ⬆️

... and 8 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@testlens-app

testlens-app Bot commented Nov 9, 2026

Copy link
Copy Markdown

✅ All tests passed ✅

🏷️ Commit: 85ed265
▶️ Tests: 130314 executed
⚪️ Checks: 26/26 completed


Learn more about TestLens at testlens.app/docs.

This branch has not been deployed

No deployments
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