File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
compiler/src/dotty/tools/dotc/parsing Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -555,9 +555,14 @@ object Scanners {
555555 token = INDENT
556556 end observeIndented
557557
558- /** Insert an <outdent> token if next token closes an indentation region */
558+ /** Insert an <outdent> token if next token closes an indentation region.
559+ * Exception: continue if indentation region belongs to a `match` and next token is `case`.
560+ */
559561 def observeOutdented (): Unit = currentRegion match
560- case r : Indented if ! r.isOutermost && closingRegionTokens.contains(token) =>
562+ case r : Indented
563+ if ! r.isOutermost
564+ && closingRegionTokens.contains(token)
565+ && ! (token == CASE && r.prefix == MATCH ) =>
561566 currentRegion = r.enclosing
562567 insert(OUTDENT , offset)
563568 case _ =>
Original file line number Diff line number Diff line change 1+ val foo : Int => Int = Some (7 ) match
2+ case Some (y) => x => y
3+ case None => identity[Int ]
You can’t perform that action at this time.
0 commit comments