Permalink
Browse files

fixing bug found by unreachability

  • Loading branch information...
adriaanm committed May 27, 2012
1 parent 379384c commit 9ebd4f94b5cd97f9e7cd369c0bc69e93248f8a5b
Showing with 2 additions and 3 deletions.
  1. +2 −3 src/compiler/scala/tools/nsc/typechecker/PatternMatching.scala
@@ -1013,11 +1013,10 @@ trait PatternMatching extends Transform with TypingTransformers with ast.TreeDSL
case SingleType(_, sym) => and(equalsTest(CODE.REF(sym), testedBinder), typeTest(testedBinder, expectedTp.widen))
// must use == to support e.g. List() == Nil
case ThisType(sym) if sym.isModule => and(equalsTest(CODE.REF(sym), testedBinder), typeTest(testedBinder, expectedTp.widen))
- case ConstantType(const) => equalsTest(expTp(Literal(const)), testedBinder)
-
- case ThisType(sym) => eqTest(expTp(This(sym)), testedBinder)
case ConstantType(Constant(null)) if testedBinder.info.widen <:< AnyRefClass.tpe
=> eqTest(expTp(CODE.NULL), testedBinder)
+ case ConstantType(const) => equalsTest(expTp(Literal(const)), testedBinder)
+ case ThisType(sym) => eqTest(expTp(This(sym)), testedBinder)
// TODO: verify that we don't need to special-case Array
// I think it's okay:

0 comments on commit 9ebd4f9

Please sign in to comment.