diff options
author | Adriaan Moors <adriaan.moors@epfl.ch> | 2012-08-06 17:13:27 +0200 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@epfl.ch> | 2012-08-07 10:35:17 +0200 |
commit | 383fd5c13741791c3311e83b1701e3535ed0aeb8 (patch) | |
tree | 910a3f9cca3401ebe1038e5988b8e9057585c075 | |
parent | 114367c0b2ce5f48186d4270c1724090fd77877b (diff) | |
download | scala-383fd5c13741791c3311e83b1701e3535ed0aeb8.tar.gz scala-383fd5c13741791c3311e83b1701e3535ed0aeb8.tar.bz2 scala-383fd5c13741791c3311e83b1701e3535ed0aeb8.zip |
SI-6183 don't crash on type error in outer test
unfortunately without test case since the report was hard to minimize
since it was a crash on erroneous code, I figured a backstop against a crash should suffice
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/PatternMatching.scala | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/PatternMatching.scala b/src/compiler/scala/tools/nsc/typechecker/PatternMatching.scala index a8286c9f19..e7466c6b47 100644 --- a/src/compiler/scala/tools/nsc/typechecker/PatternMatching.scala +++ b/src/compiler/scala/tools/nsc/typechecker/PatternMatching.scala @@ -1043,8 +1043,9 @@ trait PatternMatching extends Transform with TypingTransformers with ast.TreeDSL def outerTest(testedBinder: Symbol, expectedTp: Type): Tree = { val expectedOuter = expectedTp.prefix match { - case ThisType(clazz) => THIS(clazz) - case pre => REF(pre.prefix, pre.termSymbol) + case ThisType(clazz) => THIS(clazz) + case pre if pre != NoType => REF(pre.prefix, pre.termSymbol) + case _ => TRUE_typed // fallback for SI-6183 } // ExplicitOuter replaces `Select(q, outerSym) OBJ_EQ expectedPrefix` by `Select(q, outerAccessor(outerSym.owner)) OBJ_EQ expectedPrefix` |