Skip to content

Scala: fix for if expressions in new class#7791

Merged
greg-at-moderne merged 1 commit into
mainfrom
greg-scala-newclass-arg-prefix-statement-expression
May 27, 2026
Merged

Scala: fix for if expressions in new class#7791
greg-at-moderne merged 1 commit into
mainfrom
greg-scala-newclass-arg-prefix-statement-expression

Conversation

@greg-at-moderne
Copy link
Copy Markdown
Contributor

What's changed?

Fix Scala parser handling of statement expressions like if within new classes, e.g.

object Test {
  val x = new Foo(
    if (cond) 1 else 2,
    3)
}

What's your motivation?

They suffer from idempotency issues.

@github-project-automation github-project-automation Bot moved this to In Progress in OpenRewrite May 27, 2026
@greg-at-moderne greg-at-moderne marked this pull request as ready for review May 27, 2026 08:58
@greg-at-moderne greg-at-moderne merged commit bc7e587 into main May 27, 2026
1 check passed
@greg-at-moderne greg-at-moderne deleted the greg-scala-newclass-arg-prefix-statement-expression branch May 27, 2026 08:59
@github-project-automation github-project-automation Bot moved this from In Progress to Done in OpenRewrite May 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant