summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@epfl.ch>2012-08-06 17:13:27 +0200
committerAdriaan Moors <adriaan.moors@epfl.ch>2012-08-07 10:35:17 +0200
commit383fd5c13741791c3311e83b1701e3535ed0aeb8 (patch)
tree910a3f9cca3401ebe1038e5988b8e9057585c075
parent114367c0b2ce5f48186d4270c1724090fd77877b (diff)
downloadscala-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.scala5
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`