From c1e014c6c7da71987f21ad0db76126261c893f4e Mon Sep 17 00:00:00 2001 From: Dmitry Petrashko Date: Tue, 17 Feb 2015 15:51:38 +0100 Subject: Fix eliding of non-elidable prefix in TypeMap.andThen --- src/dotty/tools/dotc/ast/tpd.scala | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/dotty/tools/dotc/ast/tpd.scala') diff --git a/src/dotty/tools/dotc/ast/tpd.scala b/src/dotty/tools/dotc/ast/tpd.scala index 6a3c1d648..52a617ea2 100644 --- a/src/dotty/tools/dotc/ast/tpd.scala +++ b/src/dotty/tools/dotc/ast/tpd.scala @@ -261,7 +261,10 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo { true case pre: ThisType => pre.cls.isStaticOwner || - tp.symbol.is(ParamOrAccessor) && ctx.owner.enclosingClass.derivesFrom(pre.cls) + tp.symbol.is(ParamOrAccessor) && ctx.owner.enclosingClass == pre.cls + // was ctx.owner.enclosingClass.derivesFrom(pre.cls) which was not tight enough + // and was spuriously triggered in case inner class would inherit from outer one + // eg anonymous TypeMap inside TypeMap.andThen case pre: TermRef => pre.symbol.is(Module) && pre.symbol.isStatic case _ => -- cgit v1.2.3