diff options
author | Martin Odersky <odersky@gmail.com> | 2013-04-09 15:04:43 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2013-04-09 15:06:27 +0200 |
commit | 442c361aee87266fe6428f1d9a5da7de934c8cef (patch) | |
tree | 0b98d9bcd202a6cad92cb75248722d8d6e100312 | |
parent | d1c2fe7ab3b2cddb224f24ce37fdc0bf4237d5a4 (diff) | |
download | dotty-442c361aee87266fe6428f1d9a5da7de934c8cef.tar.gz dotty-442c361aee87266fe6428f1d9a5da7de934c8cef.tar.bz2 dotty-442c361aee87266fe6428f1d9a5da7de934c8cef.zip |
Added initial denotations to NamedType where feasible.
-rw-r--r-- | src/dotty/tools/dotc/core/Annotations.scala | 4 | ||||
-rw-r--r-- | src/dotty/tools/dotc/core/Symbols.scala | 2 | ||||
-rw-r--r-- | src/dotty/tools/dotc/core/Types.scala | 4 | ||||
-rw-r--r-- | src/dotty/tools/dotc/core/pickling/UnPickler.scala | 2 | ||||
-rw-r--r-- | test/test/showClass.scala | 2 |
5 files changed, 6 insertions, 8 deletions
diff --git a/src/dotty/tools/dotc/core/Annotations.scala b/src/dotty/tools/dotc/core/Annotations.scala index 1a07443ea..3226e69ea 100644 --- a/src/dotty/tools/dotc/core/Annotations.scala +++ b/src/dotty/tools/dotc/core/Annotations.scala @@ -54,10 +54,10 @@ object Annotations { deferred(atp.typeSymbol, New(atp, args)) def makeAlias(sym: TermSymbol)(implicit ctx: Context) = - apply(defn.AliasAnnot, List(Ident(TermRef(sym.owner.thisType, sym.name, sym.signature)))) + apply(defn.AliasAnnot, List(Ident(TermRef(sym.owner.thisType, sym.name, sym.signature).withDenot(sym)))) def makeChild(sym: Symbol)(implicit ctx: Context) = - apply(defn.ChildAnnot.typeConstructor.appliedTo(NamedType(sym.owner.thisType, sym.name)), Nil) + apply(defn.ChildAnnot.typeConstructor.appliedTo(NamedType(sym.owner.thisType, sym.name).withDenot(sym)), Nil) } def ThrowsAnnotation(cls: ClassSymbol)(implicit ctx: Context) = diff --git a/src/dotty/tools/dotc/core/Symbols.scala b/src/dotty/tools/dotc/core/Symbols.scala index 0e439cb5f..d040fc998 100644 --- a/src/dotty/tools/dotc/core/Symbols.scala +++ b/src/dotty/tools/dotc/core/Symbols.scala @@ -148,7 +148,7 @@ trait Symbols { this: Context => newModuleSymbol( owner, name, modFlags, clsFlags, (module, modcls) => ClassInfo( - owner.thisType, modcls, parents, decls, TermRef(owner.thisType, name, module)), + owner.thisType, modcls, parents, decls, TermRef(owner.thisType, module)), privateWithin, coord, assocFile) /** Create a package symbol with associated package class diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala index b436a4c11..bcc2da498 100644 --- a/src/dotty/tools/dotc/core/Types.scala +++ b/src/dotty/tools/dotc/core/Types.scala @@ -1043,9 +1043,7 @@ object Types { def apply(prefix: Type, name: TermName)(implicit ctx: Context): TermRef = unique(new CachedTermRef(prefix, name)) def apply(prefix: Type, sym: TermSymbol)(implicit ctx: Context): TermRefBySym = - apply(prefix, sym.name, sym) - def apply(prefix: Type, name: TermName, sym: TermSymbol)(implicit ctx: Context): TermRefBySym = - unique(new TermRefBySym(prefix, name, sym)) + unique(new TermRefBySym(prefix, sym.name, sym)) def apply(prefix: Type, name: TermName, sig: Signature)(implicit ctx: Context): TermRefWithSignature = unique(new TermRefWithSignature(prefix, name, sig)) } diff --git a/src/dotty/tools/dotc/core/pickling/UnPickler.scala b/src/dotty/tools/dotc/core/pickling/UnPickler.scala index f2cd78e35..1e272e894 100644 --- a/src/dotty/tools/dotc/core/pickling/UnPickler.scala +++ b/src/dotty/tools/dotc/core/pickling/UnPickler.scala @@ -604,7 +604,7 @@ class UnPickler(bytes: Array[Byte], classRoot: ClassDenotation, moduleClassRoot: val pre = readTypeRef() val sym = readDisambiguatedSymbolRef(_.isParameterless) if (isLocal(sym)) TermRef(pre, sym.asTerm) - else TermRef(pre, sym.name.asTermName, NotAMethod) + else TermRef(pre, sym.name.asTermName, NotAMethod).withDenot(sym) case SUPERtpe => val thistpe = readTypeRef() val supertpe = readTypeRef() diff --git a/test/test/showClass.scala b/test/test/showClass.scala index d38432e21..f0dffde77 100644 --- a/test/test/showClass.scala +++ b/test/test/showClass.scala @@ -12,6 +12,6 @@ object showClass extends ShowClassTests { showPackage("dotty") showPackage("scala") - println("done") + println("done") } } |