From 383fd5c13741791c3311e83b1701e3535ed0aeb8 Mon Sep 17 00:00:00 2001 From: Adriaan Moors Date: Mon, 6 Aug 2012 17:13:27 +0200 Subject: 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 --- src/compiler/scala/tools/nsc/typechecker/PatternMatching.scala | 5 +++-- 1 file 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` -- cgit v1.2.3