final class TermRefWithSignature
extends TermRef

Constructors

TermRefWithSignature ( prefix: Type , name: TermName , sig: Signature )

Members

private val name : TermName
private val prefix : Type
override val sig : Signature
override def computeHash : Int
override def equals ( that: Any ) : Boolean
private def fixDenot ( candidate: TermRef , prefix: Type ) ( implicit ctx: Context ) : TermRef
override def loadDenot ( implicit ctx: Context ) : Denotation
override def newLikeThis ( prefix: Type ) ( implicit ctx: Context ) : TermRef

Create a NamedType of the same kind as this type, but with a new prefix.

Create a NamedType of the same kind as this type, but with a new prefix.

[+] override def shadowed ( implicit ctx: Context ) : NamedType

Create a NamedType of the same kind as this type, but with a "inherited name". This is necessary to in situations like the following:

class B { def m: T...

Create a NamedType of the same kind as this type, but with a "inherited name". This is necessary to in situations like the following:

class B { def m: T1 } class C extends B { private def m: T2; ... C.m } object C extends C object X { ... C.m }

The two references of C.m in class C and object X refer to different definitions: The one in C refers to C#m whereas the one in X refers to B#m. But the type C.m must have only one denotation, so it can't refer to two members depending on context.

In situations like this, the reference in X would get the type <C.m>.shadowed to make clear that we mean the inherited member, not the private one.

Note: An alternative, possibly more robust scheme would be to give private members special names. A private definition would have a special name (say m' in the example above), but would be entered in its enclosing under both private and public names, so it could still be found by looking up the public name.

[+] override def signature ( implicit ctx: Context ) : Signature

The signature of this type. This is by default NotAMethod, but is overridden for PolyTypes, MethodTypes, and TermRefWithSignature types. (the reason why...

The signature of this type. This is by default NotAMethod, but is overridden for PolyTypes, MethodTypes, and TermRefWithSignature types. (the reason why we deviate from the "final-method-with-pattern-match-in-base-class" pattern is that method signatures use caching, so encapsulation is improved using an OO scheme).

override def toString : String