Skip to content

Commit 46d2324

Browse files
Apply suggestions from code review
Co-Authored-By: Nicolas Stucki <nicolas.stucki@gmail.com>
1 parent a13e9e2 commit 46d2324

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler/src/dotty/tools/dotc/parsing/Parsers.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1332,7 +1332,7 @@ object Parsers {
13321332
case DO =>
13331333
in.errorOrMigrationWarning(
13341334
i"""`do <body> while <cond>' is no longer supported,
1335-
|use `while ({<body> ; <cond>}) ()' instead.
1335+
|use `while {<body> ; <cond>} do ()' instead.
13361336
|The statement can be rewritten automatically under -language:Scala2 -migration -rewrite.
13371337
""")
13381338
val start = in.skipToken()
@@ -1353,7 +1353,7 @@ object Parsers {
13531353
}
13541354
patch(source, cond.span.endPos, "}) ()")
13551355
}
1356-
WhileDo(Block(Block(Nil, body), Block(Nil, cond)), Literal(Constant(())))
1356+
WhileDo(Block(body :: Nil, cond), Literal(Constant(())))
13571357
}
13581358
case TRY =>
13591359
val tryOffset = in.offset

0 commit comments

Comments
 (0)