From e8a160c8c64354b12423b908067a1ba328d6248f Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Thu, 24 Oct 2013 20:09:30 +0200 Subject: Fixed problem in handing of self types. Self types were not taken into account when doing a typedIdent. The fix in typedIdent caused as CyclicReference when typing the self type itself. This in turn is fixed by distinguishing more carefully in denotNamed in Namer which context we are in. --- src/dotty/tools/dotc/typer/Applications.scala | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/dotty/tools/dotc/typer/Applications.scala') diff --git a/src/dotty/tools/dotc/typer/Applications.scala b/src/dotty/tools/dotc/typer/Applications.scala index 648713571..0abaa17fe 100644 --- a/src/dotty/tools/dotc/typer/Applications.scala +++ b/src/dotty/tools/dotc/typer/Applications.scala @@ -204,10 +204,10 @@ trait Applications extends Compatibility { self: Typer => def findDefault(cx: Context): Type = { if (cx eq NoContext) NoType else if (cx.scope != cx.outer.scope && - cx.denotsNamed(methRef.name) - .filterWithPredicate(_.symbol == meth).exists) { - val denot = cx.denotsNamed(getterName).toDenot(NoPrefix) - NamedType(NoPrefix, getterName).withDenot(denot) + cx.denotNamed(methRef.name).hasAltWith(_.symbol == meth)) { + val denot = cx.denotNamed(getterName) + assert(denot.exists) + NamedType(cx.owner.thisType, getterName).withDenot(denot) } else findDefault(cx.outer) } findDefault(ctx) -- cgit v1.2.3