Skip to content

Commit 96895cb

Browse files
committed
Fix stripping refinement for pattern type
1 parent 33ece58 commit 96895cb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler/src/dotty/tools/dotc/core/PatternTypeConstrainer.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,8 @@ trait PatternTypeConstrainer { self: TypeComparer =>
140140
either(constrainPatternType(pat1, scrut), constrainPatternType(pat2, scrut))
141141
case AndType(pat1, pat2) =>
142142
constrainPatternType(pat1, scrut) && constrainPatternType(pat2, scrut)
143-
case scrut: RefinedOrRecType =>
144-
constrainPatternType(stripRefinement(scrut), pat)
143+
case pat: RefinedOrRecType =>
144+
constrainPatternType(stripRefinement(pat), scrut)
145145
case pat =>
146146
constrainSimplePatternType(pat, scrut) || classesMayBeCompatible && constrainUpcasted(scrut)
147147
}

0 commit comments

Comments
 (0)