From dc02760eac04accb9e0d5e34128f4c79cfa8c327 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Fri, 5 Sep 2014 02:56:06 +0200 Subject: Partially reverting of 08c6eaca Partial revert of 08c6eaca "this type is a term ref to the source module". The problem with doing this is that it introduces spurious outer references. An inner module that contains self referenves always needs the directly enclosing class. The revert avoids this dependency by making ThisTypes always point to TypeRefs. Several other changes were necessary to make the builds pass: TypeRefs had to get prefixes after erasure so that they can be reloaded. Symbols of such typerefs had to be retrieved without forcing a denotation. One test (blockescapes.scala) fails and is moved to pending, awaiting further resolution. Also two other new tests in pending which currently fail (and have failed before). --- src/dotty/tools/dotc/core/SymDenotations.scala | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/dotty/tools/dotc/core/SymDenotations.scala') diff --git a/src/dotty/tools/dotc/core/SymDenotations.scala b/src/dotty/tools/dotc/core/SymDenotations.scala index 487103213..e028c492c 100644 --- a/src/dotty/tools/dotc/core/SymDenotations.scala +++ b/src/dotty/tools/dotc/core/SymDenotations.scala @@ -1026,16 +1026,16 @@ object SymDenotations { } private def computeThisType(implicit ctx: Context): Type = - if (this is Package) - ThisType.raw(TypeRef(NoPrefix, symbol.asType)) - else { + ThisType.raw( + TypeRef(if (this is Package) NoPrefix else owner.thisType, symbol.asType)) +/* else { val pre = owner.thisType if (this is Module) if (isMissing(pre)) TermRef(pre, sourceModule.asTerm) else TermRef.withSig(pre, name.sourceModuleName, Signature.NotAMethod) else ThisType.raw(TypeRef(pre, symbol.asType)) } - +*/ private[this] var myTypeRef: TypeRef = null override def typeRef(implicit ctx: Context): TypeRef = { -- cgit v1.2.3