diff options
author | Adriaan Moors <adriaan.moors@epfl.ch> | 2012-05-27 23:41:56 +0200 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@epfl.ch> | 2012-06-01 16:05:47 +0200 |
commit | 9ebd4f94b5cd97f9e7cd369c0bc69e93248f8a5b (patch) | |
tree | be6b7d741253c445a7d7f51039525c1e607e041f /src | |
parent | 379384c887b01e6e8b48de671d4b2a99b6fdf520 (diff) | |
download | scala-9ebd4f94b5cd97f9e7cd369c0bc69e93248f8a5b.tar.gz scala-9ebd4f94b5cd97f9e7cd369c0bc69e93248f8a5b.tar.bz2 scala-9ebd4f94b5cd97f9e7cd369c0bc69e93248f8a5b.zip |
fixing bug found by unreachability
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/PatternMatching.scala | 5 |
1 files 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: |