Skip to content

Commit 37dc588

Browse files
committed
Observe outdent also for type cases and type blocks in quotes
These are analogous to statement sequences
1 parent b58fd14 commit 37dc588

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2015,6 +2015,7 @@ object Parsers {
20152015
def typeBlockStat(): Tree =
20162016
val mods = defAnnotsMods(BitSet())
20172017
val tdef = typeDefOrDcl(in.offset, in.skipToken(mods))
2018+
in.observeOutdented()
20182019
if in.token == SEMI then in.nextToken()
20192020
if in.isNewLine then in.nextToken()
20202021
tdef
@@ -3290,6 +3291,7 @@ object Parsers {
32903291
}
32913292
CaseDef(pat, EmptyTree, atSpan(accept(ARROW)) {
32923293
val t = rejectWildcardType(typ())
3294+
in.observeOutdented()
32933295
if in.token == SEMI then in.nextToken()
32943296
newLinesOptWhenFollowedBy(CASE)
32953297
t

tests/pos/i25513.scala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
type Foo[A, B] = (
2+
(A, B) match
3+
case (Int, Int) => (A, B),
4+
A
5+
)

0 commit comments

Comments
 (0)