aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/Types.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-02-01 15:00:03 +0100
committerMartin Odersky <odersky@gmail.com>2013-02-01 15:00:03 +0100
commit5610fe1abbb8e4cb005d644f37669f872327828b (patch)
treee8c1f9c7a18e1ea299c14d421fcd251f1c2a4dfc /src/dotty/tools/dotc/core/Types.scala
parent4faeeceffdbc8dec9dd53bf299174a13d6bf87d0 (diff)
downloaddotty-5610fe1abbb8e4cb005d644f37669f872327828b.tar.gz
dotty-5610fe1abbb8e4cb005d644f37669f872327828b.tar.bz2
dotty-5610fe1abbb8e4cb005d644f37669f872327828b.zip
Refined completion, in particular for module symbols and made contexts explicit.
Made contexts in class constructors explicit (named initctx), so that we can better track where they are used. It's important that the context is not retained in the state of the object.
Diffstat (limited to 'src/dotty/tools/dotc/core/Types.scala')
-rw-r--r--src/dotty/tools/dotc/core/Types.scala12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala
index 459f219ac..256ab7721 100644
--- a/src/dotty/tools/dotc/core/Types.scala
+++ b/src/dotty/tools/dotc/core/Types.scala
@@ -623,8 +623,8 @@ object Types {
}
}
- final class TermRefBySym(prefix: Type, val fixedSym: TermSymbol)(implicit ctx: Context)
- extends TermRef(prefix, fixedSym.name) with HasFixedSym {
+ final class TermRefBySym(prefix: Type, val fixedSym: TermSymbol)(initctx: Context)
+ extends TermRef(prefix, fixedSym.name(initctx)) with HasFixedSym {
}
final class TermRefWithSignature(prefix: Type, name: TermName, override val signature: Signature) extends TermRef(prefix, name) {
@@ -633,8 +633,8 @@ object Types {
super.loadDenot.atSignature(signature)
}
- final class TypeRefBySym(prefix: Type, val fixedSym: TypeSymbol)(implicit ctx: Context)
- extends TypeRef(prefix, fixedSym.name) with HasFixedSym {
+ final class TypeRefBySym(prefix: Type, val fixedSym: TypeSymbol)(initctx: Context)
+ extends TypeRef(prefix, fixedSym.name(initctx)) with HasFixedSym {
}
final class CachedTermRef(prefix: Type, name: TermName) extends TermRef(prefix, name)
@@ -650,7 +650,7 @@ object Types {
def apply(prefix: Type, name: TermName)(implicit ctx: Context) =
unique(new CachedTermRef(prefix, name))
def apply(prefix: Type, sym: TermSymbol)(implicit ctx: Context) =
- unique(new TermRefBySym(prefix, sym))
+ unique(new TermRefBySym(prefix, sym)(ctx))
def apply(prefix: Type, name: TermName, signature: Signature)(implicit ctx: Context) =
unique(new TermRefWithSignature(prefix, name, signature))
}
@@ -659,7 +659,7 @@ object Types {
def apply(prefix: Type, name: TypeName)(implicit ctx: Context) =
unique(new CachedTypeRef(prefix, name))
def apply(prefix: Type, sym: TypeSymbol)(implicit ctx: Context) =
- unique(new TypeRefBySym(prefix, sym))
+ unique(new TypeRefBySym(prefix, sym)(ctx))
}
// --- Other SingletonTypes: ThisType/SuperType/ConstantType ---------------------------