You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please make sure that the issue is observable using the latest version of scalafmt and
within the scalafmtCLI: https://scalameta.org/scalafmt/docs/installation.html#cli
▶ scalafmt --version
scalafmt 3.7.13
Configuration (required)
Please paste the contents of your .scalafmt.conf file here:
When I run scalafmt via CLI like this: ▶ scalafmt src/main/scala/example/Main.scala
Steps
Given code like this:
packageexample@main defmain(args: String*):Unit=vallist=List(1, 2, 3) map: x =>
x +1
Problem
Scalafmt formats code like this:
packageexample@main defmain(args: String*):Unit=vallist=List(1, 2, 3) map: x => x +1
Expectation
The code stopped compiling:
sbt:scalafmt_bug> compile
[info] compiling 1 Scala source to /Users/tkogut/scalafmt_bug/target/scala-3.3.0/classes ...
[error] -- [E018] Syntax Error: /Users/tkogut/scalafmt_bug/src/main/scala/example/Main.scala:4:30
[error] 4 | val list = List(1, 2, 3) map: x => x + 1
[error] | ^
[error] | expression expected but : found
[error] |
[error] | longer explanation available when compiling with `-explain`
[error] -- [E006] Not Found Error: /Users/tkogut/scalafmt_bug/src/main/scala/example/Main.scala:4:37
[error] 4 | val list = List(1, 2, 3) map: x => x + 1
[error] | ^
[error] | Not found: x
[error] |
[error] | longer explanation available when compiling with `-explain`
[error] two errors found
[error] (Compile / compileIncremental) Compilation failed
[error] Total time: 0 s, completed Aug 30, 2023, 12:20:26 PM
Additional observation
@main defmain(args: String*):Unit=vallist=List(1, 2, 3).map: x =>
x +1
This works ok. Notice the . (dot) after map.
The text was updated successfully, but these errors were encountered:
Please make sure that the issue is observable using the latest version of
scalafmt
andwithin the
scalafmt
CLI:https://scalameta.org/scalafmt/docs/installation.html#cli
Configuration (required)
Please paste the contents of your
.scalafmt.conf
file here:Command-line parameters (required)
When I run scalafmt via CLI like this:
▶ scalafmt src/main/scala/example/Main.scala
Steps
Given code like this:
Problem
Scalafmt formats code like this:
Expectation
The code stopped compiling:
Additional observation
This works ok. Notice the
.
(dot) aftermap
.The text was updated successfully, but these errors were encountered: