Skip to content

-rewrite -indent adds invalid : after with for given #11895

Closed
@jrduncans

Description

@jrduncans

Compiler version

3.0.0-RC1

Minimized code

given scala.util.CommandLineParser.FromString[MyEnum] with {
  def fromString(s: String): MyEnum = MyEnum.valueOf(s)
}

Output

given scala.util.CommandLineParser.FromString[MyEnum] with:
  def fromString(s: String): MyEnum = MyEnum.valueOf(s)

Which then fails to compile with:

[error] -- [E040] Syntax Error: ...src/main/scala/Main.scala:7:61
[error] 7 |given scala.util.CommandLineParser.FromString[MyEnum] with:
[error]   |                                                             ^
[error]   |                                     an identifier expected, but ':' found

Expectation

Rewrite should produce valid code

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions