From 3c3b32346f2c4eafe26cc9659b41ae50b0316b92 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Sun, 17 Jul 2016 18:29:30 +0200 Subject: Fix outer test in pattern matcher Previous test did not reflect deeper paths for outer references. This caused a -Ycheck:patMat failure for i1269.scala. --- src/dotty/tools/dotc/transform/PatternMatcher.scala | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/dotty/tools/dotc/transform/PatternMatcher.scala') diff --git a/src/dotty/tools/dotc/transform/PatternMatcher.scala b/src/dotty/tools/dotc/transform/PatternMatcher.scala index 974053769..92d638be9 100644 --- a/src/dotty/tools/dotc/transform/PatternMatcher.scala +++ b/src/dotty/tools/dotc/transform/PatternMatcher.scala @@ -763,9 +763,8 @@ class PatternMatcher extends MiniPhaseTransform with DenotTransformer {thisTrans def outerTest(testedBinder: Symbol, expectedTp: Type): Tree = { val expectedOuter = expectedTp.normalizedPrefix match { - //case ThisType(clazz) => This(clazz) //case NoType => Literal(Constant(true)) // fallback for SI-6183 todo? - case pre => ref(pre.termSymbol) + case pre: SingletonType => singleton(pre) } // ExplicitOuter replaces `Select(q, outerSym) OBJ_EQ expectedPrefix` by `Select(q, outerAccessor(outerSym.owner)) OBJ_EQ expectedPrefix` -- cgit v1.2.3