Skip to content

Commit b574ac0

Browse files
DarkDimiusodersky
authored andcommitted
Fix #453, patternMatcher should use ==
1 parent 957923e commit b574ac0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/dotty/tools/dotc/transform/PatternMatcher.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,8 @@ class PatternMatcher extends MiniPhaseTransform with DenotTransformer {thisTrans
141141
}
142142

143143
// NOTE: checker must be the target of the ==, that's the patmat semantics for ya
144-
def _equals(checker: Tree, binder: Symbol): Tree = checker.select(nme.equals_).appliedTo(ref(binder))
144+
def _equals(checker: Tree, binder: Symbol): Tree =
145+
tpd.applyOverloaded(checker, nme.EQ, List(ref(binder)), List.empty, defn.BooleanType)
145146

146147
// the force is needed mainly to deal with the GADT typing hack (we can't detect it otherwise as tp nor pt need contain an abstract type, we're just casting wildly)
147148
def _asInstanceOf(b: Symbol, tp: Type): Tree = ref(b).ensureConforms(tp) // andType here breaks t1048

0 commit comments

Comments
 (0)