Skip to content

Keep parentheses when renaming typed lambda parameter to underscore#1082

Merged
timtebeek merged 1 commit intomainfrom
tim/lambda-underscore-parens
May 4, 2026
Merged

Keep parentheses when renaming typed lambda parameter to underscore#1082
timtebeek merged 1 commit intomainfrom
tim/lambda-underscore-parens

Conversation

@timtebeek
Copy link
Copy Markdown
Member

@timtebeek timtebeek commented May 4, 2026

Summary

Test plan

  • ./gradlew test --tests ReplaceUnusedVariablesWithUnderscoreTest passes

A single explicitly typed lambda parameter like `(RequestContext rc) -> ...`
must remain parenthesized after renaming to `_`, otherwise the resulting
`RequestContext _ -> ...` is invalid Java.

Fixes #1080
@github-project-automation github-project-automation Bot moved this to In Progress in OpenRewrite May 4, 2026
@timtebeek timtebeek merged commit 915f92e into main May 4, 2026
1 check passed
@timtebeek timtebeek deleted the tim/lambda-underscore-parens branch May 4, 2026 18:50
@github-project-automation github-project-automation Bot moved this from In Progress to Done in OpenRewrite May 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

ReplaceUnusedVariablesWithUnderscore produces invalid syntax for typed lambda parameters

1 participant