Skip to content

fix: Improved type checking for UnnecessaryLambdaEnclosingParameters#910

Open
gbq6 wants to merge 3 commits intosolven-eu:masterfrom
gbq6:feature/improve-type-check
Open

fix: Improved type checking for UnnecessaryLambdaEnclosingParameters#910
gbq6 wants to merge 3 commits intosolven-eu:masterfrom
gbq6:feature/improve-type-check

Conversation

@gbq6
Copy link
Contributor

@gbq6 gbq6 commented Sep 28, 2025

No description provided.

@gbq6 gbq6 requested a review from blacelle as a code owner September 28, 2025 16:29
var newLambdaExpr = lambdaExpr.clone();
newLambdaExpr.setEnclosingParameters(false);
return tryReplace(lambdaExpr, newLambdaExpr);
if (lambdaExpr.getParameters().size() != 1 || lambdaExpr.isExplicitlyTyped()) {
Copy link
Member

Choose a reason for hiding this comment

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

Could you craft a unit-test catching what's brought by this PR?

Copy link
Contributor Author

@gbq6 gbq6 Sep 28, 2025

Choose a reason for hiding this comment

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

Actually any test with @CompareMethods would have revealed this issue, but as the the JavaParser seems to ignore setEnclosingParameters(false) these tests are ignored. I'll add a comment regarding that if you don't mind though.

Edit: 24f869e

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