diff options
author | Martin Odersky <odersky@gmail.com> | 2014-01-10 03:41:49 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2014-01-10 17:20:41 +0100 |
commit | 5d38be773a2083fa2112f5cb688070b867634120 (patch) | |
tree | 63eebc91accacb51faade6cf4ece4f271911a13d /src/dotty/tools/dotc/core/SymDenotations.scala | |
parent | a63c3db753e8dcc0ed9daa3834ac7a01d6748540 (diff) | |
download | dotty-5d38be773a2083fa2112f5cb688070b867634120.tar.gz dotty-5d38be773a2083fa2112f5cb688070b867634120.tar.bz2 dotty-5d38be773a2083fa2112f5cb688070b867634120.zip |
Mover termRef/typeRef and friends up to Denotation.
Needed for implicit search, because some implicits might be UniqueRefs, not SymDenotations
Diffstat (limited to 'src/dotty/tools/dotc/core/SymDenotations.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/SymDenotations.scala | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/src/dotty/tools/dotc/core/SymDenotations.scala b/src/dotty/tools/dotc/core/SymDenotations.scala index 1904fdbb5..58f148ba5 100644 --- a/src/dotty/tools/dotc/core/SymDenotations.scala +++ b/src/dotty/tools/dotc/core/SymDenotations.scala @@ -654,34 +654,18 @@ object SymDenotations { /** The type This(cls), where cls is this class, NoPrefix for all other symbols */ def thisType(implicit ctx: Context): Type = NoPrefix - /** The TypeRef representing this type denotation at its original location. */ - def typeRef(implicit ctx: Context): TypeRef = + override def typeRef(implicit ctx: Context): TypeRef = TypeRef(owner.thisType, name.asTypeName, this) - /** The TermRef representing this term denotation at its original location. */ - def termRef(implicit ctx: Context): TermRef = + override def termRef(implicit ctx: Context): TermRef = TermRef(owner.thisType, name.asTermName, this) - /** The TermRef representing this term denotation at its original location - * and at signature `NotAMethod`. - */ - def valRef(implicit ctx: Context): TermRef = + override def valRef(implicit ctx: Context): TermRef = TermRef.withSig(owner.thisType, name.asTermName, Signature.NotAMethod, this) - /** The TermRef representing this term denotation at its original location - * at the denotation's signature. - * @note Unlike `valRef` and `termRef`, this will force the completion of the - * denotation via a call to `info`. - */ - def termRefWithSig(implicit ctx: Context): TermRef = + override def termRefWithSig(implicit ctx: Context): TermRef = TermRef.withSig(owner.thisType, name.asTermName, signature, this) - /** The NamedType representing this denotation at its original location. - * Same as either `typeRef` or `termRefWithSig` depending whether this denotes a type or not. - */ - def namedType(implicit ctx: Context): NamedType = - if (isType) typeRef else termRefWithSig - /** The variance of this type parameter or type member as an Int, with * +1 = Covariant, -1 = Contravariant, 0 = Nonvariant, or not a type parameter */ |