aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/transform/PatternMatcher.scala
diff options
context:
space:
mode:
authorDmitry Petrashko <dmitry.petrashko@gmail.com>2015-04-03 14:59:22 +0200
committerMartin Odersky <odersky@gmail.com>2015-04-09 13:11:35 +0200
commitb574ac0727ab704d0cbb037047021e791e0c70d1 (patch)
treebd1be1dc81b226f0d97abbb4fdcdab6f9b259a69 /src/dotty/tools/dotc/transform/PatternMatcher.scala
parent957923ec75c71ac9f7efe67823781438177aaa59 (diff)
downloaddotty-b574ac0727ab704d0cbb037047021e791e0c70d1.tar.gz
dotty-b574ac0727ab704d0cbb037047021e791e0c70d1.tar.bz2
dotty-b574ac0727ab704d0cbb037047021e791e0c70d1.zip
Fix #453, patternMatcher should use ==
Diffstat (limited to 'src/dotty/tools/dotc/transform/PatternMatcher.scala')
-rw-r--r--src/dotty/tools/dotc/transform/PatternMatcher.scala3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/transform/PatternMatcher.scala b/src/dotty/tools/dotc/transform/PatternMatcher.scala
index 33e52e068..1336d39e4 100644
--- a/src/dotty/tools/dotc/transform/PatternMatcher.scala
+++ b/src/dotty/tools/dotc/transform/PatternMatcher.scala
@@ -141,7 +141,8 @@ class PatternMatcher extends MiniPhaseTransform with DenotTransformer {thisTrans
}
// NOTE: checker must be the target of the ==, that's the patmat semantics for ya
- def _equals(checker: Tree, binder: Symbol): Tree = checker.select(nme.equals_).appliedTo(ref(binder))
+ def _equals(checker: Tree, binder: Symbol): Tree =
+ tpd.applyOverloaded(checker, nme.EQ, List(ref(binder)), List.empty, defn.BooleanType)
// 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)
def _asInstanceOf(b: Symbol, tp: Type): Tree = ref(b).ensureConforms(tp) // andType here breaks t1048