Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/parsing/Scanners.scala
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ object Scanners {
|| nextWidth == lastWidth && (indentPrefix == MATCH || indentPrefix == CATCH) && token != CASE then
if currentRegion.isOutermost then
if nextWidth < lastWidth then currentRegion = topLevelRegion(nextWidth)
else if !isLeadingInfixOperator(nextWidth) && !statCtdTokens.contains(lastToken) then
else if !isLeadingInfixOperator(nextWidth) && !statCtdTokens.contains(lastToken) && lastToken != INDENT then
currentRegion match
case r: Indented =>
currentRegion = r.enclosing
Expand Down
10 changes: 10 additions & 0 deletions tests/pos/i14061.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
def main(args: Array[String]): Unit =
val bar: PartialFunction[Throwable, Unit] =
case e: IllegalArgumentException => e.printStackTrace
case e: Throwable => e.printStackTrace
try
println("a")
catch
bar
finally
println("a")