From 9ebd4f94b5cd97f9e7cd369c0bc69e93248f8a5b Mon Sep 17 00:00:00 2001 From: Adriaan Moors Date: Sun, 27 May 2012 23:41:56 +0200 Subject: fixing bug found by unreachability --- src/compiler/scala/tools/nsc/typechecker/PatternMatching.scala | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/compiler/scala/tools/nsc/typechecker/PatternMatching.scala b/src/compiler/scala/tools/nsc/typechecker/PatternMatching.scala index 21b80df735..5f8ae240cc 100644 --- a/src/compiler/scala/tools/nsc/typechecker/PatternMatching.scala +++ b/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: -- cgit v1.2.3