Skip to content

Commit 3ba9549

Browse files
oderskynicolasstucki
authored andcommitted
Drop Block(...) around quoted and spliced expressions where possible
1 parent c5d26e4 commit 3ba9549

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -923,7 +923,12 @@ object Parsers {
923923
val saved = in.inQuote
924924
in.inQuote = isQuote
925925
inDefScopeBraces {
926-
try block() finally in.inQuote = saved
926+
try
927+
block() match {
928+
case Block(Nil, expr) => expr
929+
case t => t
930+
}
931+
finally in.inQuote = saved
927932
}
928933
}
929934

0 commit comments

Comments
 (0)