Skip to content

Commit 904f407

Browse files
Merge pull request #9739 from dotty-staging/fix-9736
Fix #9736: Dealias in unrelated check
2 parents 101e620 + 8d931b8 commit 904f407

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

compiler/src/dotty/tools/dotc/transform/TypeTestsCasts.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ object TypeTestsCasts {
185185
else if tp.isRef(defn.AnyValClass) then defn.AnyClass
186186
else tp.classSymbol
187187

188-
def foundClasses(tp: Type, acc: List[Symbol]): List[Symbol] = tp match
188+
def foundClasses(tp: Type, acc: List[Symbol]): List[Symbol] = tp.dealias match
189189
case OrType(tp1, tp2) => foundClasses(tp2, foundClasses(tp1, acc))
190190
case _ => effectiveClass(tp) :: acc
191191

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
class Test {
2+
type MyCombo = Int | Unit
3+
val z: MyCombo = 10
4+
z match
5+
case i: Int => ???
6+
case _ => ???
7+
}

0 commit comments

Comments
 (0)