Skip to content

Commit f530c71

Browse files
committed
Drop Block(...) around quoted and spliced expressions where possible
1 parent 347a04c commit f530c71

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
@@ -915,7 +915,12 @@ object Parsers {
915915
val saved = in.inQuote
916916
in.inQuote = isQuote
917917
inDefScopeBraces {
918-
try block() finally in.inQuote = saved
918+
try
919+
block() match {
920+
case Block(Nil, expr) => expr
921+
case t => t
922+
}
923+
finally in.inQuote = saved
919924
}
920925
}
921926

0 commit comments

Comments
 (0)