Term symbols have their names of type TermName
.
Term symbols have their names of type TermName
.
Test two objects for inequality.
Test two objects for inequality.
true
if !(this == that), false otherwise.
Equivalent to x.hashCode
except for boxed numeric types and null
.
Equivalent to x.hashCode
except for boxed numeric types and null
.
For numerics, it returns a hash value which is consistent
with value equality: if two value type instances compare
as true, then ## will produce the same hash value for each
of them.
For null
returns a hashcode where null.hashCode
throws a
NullPointerException
.
a hash value consistent with ==
Test two objects for equality.
Test two objects for equality.
The expression x == that
is equivalent to if (x eq null) that eq null else x.equals(that)
.
true
if the receiver object is equivalent to the argument; false
otherwise.
String representation of symbol's kind, suitable for the masses.
The class or term up to which this symbol is accessible, or RootClass if it is public.
The class or term up to which this symbol is accessible, or RootClass if it is public. As java protected statics are otherwise completely inaccessible in scala, they are treated as public.
The symbol accessed by this accessor function, but with given owner type.
The symbol accessed by this accessor function, but with given owner type.
The symbol accessed by this accessor (getter or setter) function.
The symbol accessed by this accessor (getter or setter) function.
If this is an accessor, the accessed symbol.
If this is an accessor, the accessed symbol. Otherwise, this symbol.
Accurate string representation of symbols' kind, suitable for developers.
Accurate string representation of symbols' kind, suitable for developers.
For a paramaccessor: a superclass paramaccessor for which this symbol is an alias, NoSymbol for all others.
For a paramaccessor: a superclass paramaccessor for which this symbol is an alias, NoSymbol for all others.
Returns all symbols overriden by this symbol.
Returns all symbols overriden by this symbol.
All directly or indirectly inherited classes.
All directly or indirectly inherited classes.
After the typer phase (before, look at the definition's Modifiers), contains the annotations attached to member a definition (class, method, type, field).
After the typer phase (before, look at the definition's Modifiers), contains the annotations attached to member a definition (class, method, type, field).
This symbol cast to a ClassSymbol representing a class or trait.
This symbol cast to a ClassSymbol representing a class or trait.
Returns ClassCastException if isClass
is false.
This symbol cast to a free term symbol.
This symbol cast to a free term symbol.
Returns ClassCastException if isFreeTerm
is false.
This symbol cast to a free type symbol.
This symbol cast to a free type symbol.
Returns ClassCastException if isFreeType
is false.
Cast the receiver object to be of type T0
.
Cast the receiver object to be of type T0
.
Note that the success of a cast at runtime is modulo Scala's erasure semantics.
Therefore the expression 1.asInstanceOf[String]
will throw a ClassCastException
at
runtime, while the expression List(1).asInstanceOf[List[String]]
will not.
In the latter example, because the type argument is erased as part of compilation it is
not possible to check whether the contents of the list are of the requested type.
the receiver object.
if the receiver object is not an instance of the erasure of type T0
.
This symbol cast to a MethodSymbol.
This symbol cast to a MethodSymbol.
Returns ClassCastException if isMethod
is false.
This symbol cast to a ModuleSymbol defined by an object definition.
This symbol cast to a ModuleSymbol defined by an object definition.
Returns ClassCastException if isModule
is false.
This symbol cast to a TermSymbol.
This symbol cast to a TermSymbol.
Returns ClassCastException if isTerm
is false.
This symbol cast to a TypeSymbol.
This symbol cast to a TypeSymbol.
Returns ClassCastException if isType
is false.
Overridden in ModuleSymbols to delegate to the module class.
Overridden in ModuleSymbols to delegate to the module class.
For a case class, the symbols of the accessor methods, one for each argument in the first parameter list of the primary constructor.
For a case class, the symbols of the accessor methods, one for each argument in the first parameter list of the primary constructor. The empty list for all other classes.
The case module corresponding to this case class
The case module corresponding to this case class
If this is a sealed class, its known direct subclasses.
If this is a sealed class, its known direct subclasses. Otherwise, the empty set.
The least proper supertype of a class; includes all parent types and refinement where needed.
The least proper supertype of a class; includes all parent types and refinement where needed. You need to compute that in a situation like this: { class C extends P { ... } new C }
Create a copy of the receiver object.
A clone of this symbol, but with given owner.
A clone of this symbol, but with given owner.
A clone of this symbol.
A clone of this symbol.
Internal method to clone a symbol's implementation with the given flags and no info.
Internal method to clone a symbol's implementation with the given flags and no info.
For a module: the class with the same name in the same package.
For a module: the class with the same name in the same package. For all others: NoSymbol Note: does not work for classes owned by methods, see Namers.companionClassOf
object Foo . companionClass --> class Foo
!!! linkedClassOfClass depends on companionClass on the module class getting to the class. As presently implemented this potentially returns class for any symbol except NoSymbol.
For a class: the module or case class factory with the same name in the same package.
For a class: the module or case class factory with the same name in the same package. For all others: NoSymbol Note: does not work for modules owned by methods, see Namers.companionModuleOf
class Foo . companionModule --> object Foo
For a module: its linked class For a plain class: its linked module or case factory.
For a module: its linked class For a plain class: its linked module or case factory. Note: does not work for modules owned by methods, see Namers.companionSymbolOf
class Foo <-- companionSymbol --> object Foo
Modify term symbol's type so that a raw type C is converted to an existential C[_]
Modify term symbol's type so that a raw type C is converted to an existential C[_]
This is done in checkAccessible and overriding checks in refchecks We can't do this on class loading because it would result in infinite cycles.
Symbol creation implementations.
Symbol creation implementations.
If this symbol is a type parameter skolem (not an existential skolem!) its corresponding type parameter, otherwise this
If this symbol is a type parameter skolem (not an existential skolem!) its corresponding type parameter, otherwise this
The decoded name of the symbol, e.
The decoded name of the symbol, e.g. ==
instead of $eq$eq
.
String representation of symbol's definition.
String representation of symbol's definition. It uses the symbol's raw info to avoid forcing types.
String representation of symbol's definition, using the supplied info rather than the symbol's.
String representation of symbol's definition, using the supplied info rather than the symbol's.
The owner, skipping package objects.
The owner, skipping package objects.
The next enclosing class.
The next enclosing class.
The next enclosing method.
The next enclosing method.
If this symbol is a class, this symbol; otherwise the next enclosing
class, or NoSymbol
if none exists.
If this symbol is a class, this symbol; otherwise the next enclosing
class, or NoSymbol
if none exists.
If this symbol is a method, this symbol; otherwise the next enclosing
method, or NoSymbol
if none exists.
If this symbol is a method, this symbol; otherwise the next enclosing
method, or NoSymbol
if none exists.
The package containing this symbol, or NoSymbol if there is not one.
The package containing this symbol, or NoSymbol if there is not one.
The package class containing this symbol, or NoSymbol if there is not one.
The package class containing this symbol, or NoSymbol if there is not one.
The package class containing this symbol, or NoSymbol if there is not one.
The top-level class containing this symbol.
The name of the symbol before decoding, e.
The name of the symbol before decoding, e.g. $eq$eq
instead of ==
.
Tests whether the argument (arg0
) is a reference to the receiver object (this
).
Tests whether the argument (arg0
) is a reference to the receiver object (this
).
The eq
method implements an equivalence relation on
non-null instances of AnyRef
, and has three additional properties:
x
and y
of type AnyRef
, multiple invocations of
x.eq(y)
consistently returns true
or consistently returns false
.x
of type AnyRef
, x.eq(null)
and null.eq(x)
returns false
.null.eq(null)
returns true
. When overriding the equals
or hashCode
methods, it is important to ensure that their behavior is
consistent with reference equality. Therefore, if two objects are references to each other (o1 eq o2
), they
should be equal to each other (o1 == o2
) and they should hash to the same value (o1.hashCode == o2.hashCode
).
true
if the argument is a reference to the receiver object; false
otherwise.
The equality method for reference types.
If we quantify existentially over this symbol, the bound of the type variable that stands for it pre: symbol is a term, a class, or an abstract type (no alias type allowed)
If we quantify existentially over this symbol, the bound of the type variable that stands for it pre: symbol is a term, a class, or an abstract type (no alias type allowed)
String representation of existentially bound variable
String representation of existentially bound variable
change name by appending $$<fully-qualified-name-of-class base
>
Do the same for any accessed symbols or setters/getters
change name by appending $$<fully-qualified-name-of-class base
>
Do the same for any accessed symbols or setters/getters
Returns all symbols overridden by this symbol, plus all matching symbols defined in parents of the selftype.
Returns all symbols overridden by this symbol, plus all matching symbols defined in parents of the selftype.
.
Called by the garbage collector on the receiver object when there are no more references to the object.
Called by the garbage collector on the receiver object when there are no more references to the object.
The details of when and if the finalize
method is invoked, as
well as the interaction between finalize
and non-local returns
and exceptions, are all platform dependent.
The first parameter to the first argument list of this method, or NoSymbol if inapplicable.
The first parameter to the first argument list of this method, or NoSymbol if inapplicable.
Return the accessor method of the first parameter of this class.
Return the accessor method of the first parameter of this class. or NoSymbol if it does not exist.
The default mask determining which flags to display.
The printable representation of this entity's flags and access boundary, restricted to flags in the given mask.
The printable representation of this entity's flags and access boundary, restricted to flags in the given mask.
Though both Symbol and Modifiers widen this method to public, it's defined protected here to give us the option in the future to route flag methods through accessors and disallow raw flag manipulation.
Though both Symbol and Modifiers widen this method to public, it's defined protected here to give us the option in the future to route flag methods through accessors and disallow raw flag manipulation. And after that, perhaps, on some magical day: a typesafe enumeration.
Returns the rawInfo of the owner.
Returns the rawInfo of the owner. If the current phase has flat classes, it first applies all pending type maps to this symbol.
assume this is the ModuleSymbol for B in the following definition: package p { class A { object B { val x = 1 } } }
The owner after flatten is "package p" (see "def owner"). The flatten type map enters symbol B in the decls of p. So to find a linked symbol ("object B" or "class B") we need to apply flatten to B first. Fixes #2470.
Returns string formatted according to given format
string.
Returns string formatted according to given format
string.
Format strings are as for String.format
(@see java.lang.String.format).
The encoded full path name of this symbol, where outer names and inner names are separated by periods.
The encoded full path name of this symbol, where outer names and inner names are separated by periods.
The encoded full path name of this symbol, where outer names and inner names
are separated by separator
characters.
The encoded full path name of this symbol, where outer names and inner names
are separated by separator
characters.
Never translates expansions of operators back to operator symbol.
Never adds id.
Drops package objects.
A list of annotations attached to this Symbol.
A list of annotations attached to this Symbol.
A representation that corresponds to the dynamic class of the receiver object.
A representation that corresponds to the dynamic class of the receiver object.
The nature of the representation is platform dependent.
a representation that corresponds to the dynamic class of the receiver object.
not specified by SLS as a member of AnyRef
The getter of this value or setter definition in class base
, or NoSymbol if
none exists.
The getter of this value or setter definition in class base
, or NoSymbol if
none exists.
Does symbol have a private or protected qualifier set?
Does symbol have ALL the flags in mask
set?
Does symbol have ALL the flags in mask
set?
Test for, get, or remove an annotation
Test for, get, or remove an annotation
Does symbol have ANY flag in mask
set?
Does symbol have ANY flag in mask
set?
If the name of the symbol's owner should be used when you care about seeing an interesting name: in such cases this symbol is e.
If the name of the symbol's owner should be used when you care about seeing an interesting name: in such cases this symbol is e.g. a method parameter with a synthetic name, a constructor named "this", an object "package", etc. The kind string, if non-empty, will be phrased relative to the name of the owner.
Whether this entity has NONE of the flags in the given mask.
Whether this entity has NONE of the flags in the given mask.
Same as ownerChain contains sym
but more efficient, and
with a twist for refinement classes (see RefinementClassSymbol.
Same as ownerChain contains sym
but more efficient, and
with a twist for refinement classes (see RefinementClassSymbol.)
Was symbol's type updated during given phase?
Was symbol's type updated during given phase?
The hashCode method for reference types.
An id number which is unique for all symbols in this universe
An id number which is unique for all symbols in this universe
If settings.
If settings.uniqid is set, the symbol's id, else ""
The implementation class of a trait.
The implementation class of a trait. If available it will be the symbol with the same owner, and the name of this symbol with $class appended to it.
Get type info associated with symbol at current phase, after ensuring that symbol is initialized (i.
Get type info associated with symbol at current phase, after ensuring that symbol is initialized (i.e. type is completed).
String representation of symbol's definition following its name
String representation of symbol's definition following its name
Set the symbol's flags to the given value, asserting that the previous value was 0.
Set the symbol's flags to the given value, asserting that the previous value was 0.
Initialize the symbol
Initialize the symbol
These are all tests for varieties of ClassSymbol, which has these subclasses:
These are all tests for varieties of ClassSymbol, which has these subclasses:
Does this symbol represent the definition of an abstract type?
If yes, isType
is also guaranteed to be true.
Qualities of Terms, always false for TypeSymbols.
Qualities of Terms, always false for TypeSymbols.
Does this symbol represent the definition of a type alias?
If yes, isType
is also guaranteed to be true.
Does this symbol denote an auxiliary constructor of its enclosing class?
Does this symbol denote an auxiliary constructor of its enclosing class?
The bottom classes are Nothing and Null, found in Definitions.
The bottom classes are Nothing and Null, found in Definitions.
Qualities of MethodSymbols, always false for TypeSymbols and other TermSymbols.
Qualities of MethodSymbols, always false for TypeSymbols and other TermSymbols.
Is this symbol a synthetic apply or unapply method in a companion object of a case class?
Is this symbol a synthetic apply or unapply method in a companion object of a case class?
Does this symbol represent the definition of a class or trait?
If yes, isType
is also guaranteed to be true.
Does this symbol represent the definition of a class or trait?
If yes, isType
is also guaranteed to be true.
Is this symbol defined in the same scope and compilation unit as that
symbol?
Is this symbol defined in the same scope and compilation unit as that
symbol?
Is this symbol a constant?
Is this symbol a constant?
Qualities of Types, always false for TermSymbols.
Qualities of Types, always false for TermSymbols.
Does this symbol represent the definition of a custom value class? Namely, is AnyVal among its parent classes? TODO: Why not just have in reflect.
Is this symbol an effective root for fullname string?
Is this symbol an effective root for fullname string?
Is this symbol effectively final? I.
Is this symbol effectively final? I.e, it cannot be overridden
Does this symbol or its underlying type represent a typechecking error?
Does this symbol represent an existentially bound type?
If yes, isType
is also guaranteed to be true.
Does this symbol represent an existentially bound type?
If yes, isType
is also guaranteed to be true.
Does this symbol represent a free term captured by reification?
If yes, isTerm
is also guaranteed to be true.
Does this symbol represent a free term captured by reification?
If yes, isTerm
is also guaranteed to be true.
Does this symbol represent a free type captured by reification?
If yes, isType
is also guaranteed to be true.
Does this symbol represent a free type captured by reification?
If yes, isType
is also guaranteed to be true.
Does this symbol represent a getter of a field?
If yes, isTerm
and isMethod
are also guaranteed to be true.
Does this symbol represent a getter of a field?
If yes, isTerm
and isMethod
are also guaranteed to be true.
Is this a symbol which exists only in the implementation class, not in its trait?
Is this a symbol which exists only in the implementation class, not in its trait?
A a member of class base
is incomplete if
(1) it is declared deferred or
(2) it is abstract override and its super symbol in base
is
nonexistent or incomplete.
A a member of class base
is incomplete if
(1) it is declared deferred or
(2) it is abstract override and its super symbol in base
is
nonexistent or incomplete.
...
...
Test whether the dynamic type of the receiver object is T0
.
Test whether the dynamic type of the receiver object is T0
.
Note that the result of the test is modulo Scala's erasure semantics.
Therefore the expression 1.isInstanceOf[String]
will return false
, while the
expression List(1).isInstanceOf[List[String]]
will return true
.
In the latter example, because the type argument is erased as part of compilation it is
not possible to check whether the contents of the list are of the specified type.
true
if the receiver object is an instance of erasure of type T0
; false
otherwise.
Does this symbol denote a wrapper created by the repl?
Does this symbol denote a wrapper created by the repl?
A total ordering between symbols that refines the class inheritance graph (i.
A total ordering between symbols that refines the class
inheritance graph (i.e. subclass.isLess(superclass) always holds).
the ordering is given by: (_.isType, -_.baseTypeSeq.length) for type symbols, followed by id
.
Is this symbol locally defined? I.
Is this symbol locally defined? I.e. not accessed from outside this
instance
Is this class locally defined? A class is local, if
Is this class locally defined? A class is local, if
Determines whether this symbol can be loaded by subsequent reflective compilation
Is this symbol a member of class clazz
?
Is this symbol a member of class clazz
?
Does this symbol represent the definition of a method?
If yes, isTerm
is also guaranteed to be true.
Does this symbol represent the definition of a method?
If yes, isTerm
is also guaranteed to be true.
Does this symbol represent the definition of a module (i.
Does this symbol represent the definition of a module (i.e. it
results from an object definition?).
If yes, isTerm
is also guaranteed to be true.
Does this symbol represent the definition of a class implicitly associated with an object definition (module class in scala compiler parlance).
Does this symbol represent the definition of a class implicitly associated
with an object definition (module class in scala compiler parlance).
If yes, isType
is also guaranteed to be true.
Is symbol a monomorphic type? assumption: if a type starts out as monomorphic, it will not acquire type parameters in later phases.
Is symbol a monomorphic type? assumption: if a type starts out as monomorphic, it will not acquire type parameters in later phases.
Is this class nested in another class or module (not a package)?
Is this class nested in another class or module (not a package)?
A partial ordering between symbols.
A partial ordering between symbols. (this isNestedIn that) holds iff this symbol is defined within a class or method defining that symbol
Is this class symbol a subclass of that symbol, and is this class symbol also different from Null or Nothing?
Is this class symbol a subclass of that symbol, and is this class symbol also different from Null or Nothing?
A Type, but not a Class.
A Type, but not a Class.
Does this symbol represent the definition of a numeric value class? Namely, is it one of Double, Float, Long, Int, Char, Short, Byte, Unit or Boolean?
Conditions where we omit the prefix when printing a symbol, to avoid unpleasantries like Predef.
Conditions where we omit the prefix when printing a symbol, to avoid unpleasantries like Predef.String, $iw.$iw.Foo and <empty>.Bippy.
Is this a term symbol only defined in a refinement (so that it needs to be accessed by reflection)?
Is this a term symbol only defined in a refinement (so that it needs to be accessed by reflection)?
Is this symbol an accessor method for outer?
Is this symbol an accessor method for outer?
Is this symbol an accessor method for outer?
Is this symbol an accessor method for outer?
Is this symbol an overloaded method?
Is this symbol an overloaded method?
Equivalent to allOverriddenSymbols.
Equivalent to allOverriddenSymbols.nonEmpty, but more efficient.
Does this symbol represent the definition of a package?
If yes, isTerm
is also guaranteed to be true.
Does this symbol represent the definition of a package?
If yes, isTerm
is also guaranteed to be true.
Package/package object tests
Does this symbol denote the primary constructor of its enclosing class?
Does this symbol denote the primary constructor of its enclosing class?
Does this symbol represent the definition of a primitive class? Namely, is it one of Double, Float, Long, Int, Char, Short, Byte, Unit or Boolean?
Overridden in custom objects in Definitions
Overridden in custom objects in Definitions
Does this symbol represent a setter of a field?
If yes, isTerm
and isMethod
are also guaranteed to be true.
Does this symbol represent a setter of a field?
If yes, isTerm
and isMethod
are also guaranteed to be true.
Does this symbol denote a stable value?
Does this symbol denote a stable value?
Is this symbol static (i.
Is this symbol static (i.e. with no outer instance)? Q: When exactly is a sym marked as STATIC? A: If it's a member of a toplevel object, or of an object contained in a toplevel object, or any number of levels deep. http://groups.google.com/group/scala-internals/browse_thread/thread/d385bcd60b08faf6
Is this symbol a static constructor?
Is this symbol a static constructor?
Is this symbol a static member of its class? (i.
Is this symbol a static member of its class? (i.e. needs to be implemented as a Java static?)
Does this symbol denote a class that defines static symbols?
Does this symbol denote a class that defines static symbols?
Is this class or type defined as a structural refinement type?
Is this class or type defined as a structural refinement type?
Overridden in NullClass and NothingClass for custom behavior.
Overridden in NullClass and NothingClass for custom behavior.
Does this symbol represent the definition of a term? Note that every symbol is either a term or a term.
Does this symbol represent the definition of a term?
Note that every symbol is either a term or a term.
So for every symbol sym
, either sym.isTerm
is true
or sym.isTerm
is true.
Does this symbol represent the definition of a type? Note that every symbol is either a term or a type.
Does this symbol represent the definition of a type?
Note that every symbol is either a term or a type.
So for every symbol sym
, either sym.isTerm
is true
or sym.isType
is true.
Was symbol's type updated during given phase?
Was symbol's type updated during given phase?
Term symbols with the exception of static parts of Java classes and packages.
Term symbols with the exception of static parts of Java classes and packages.
Does this symbol represent a mutable value?
If yes, isTerm
and isValue
are also guaranteed to be true.
Does this symbol represent a mutable value?
If yes, isTerm
and isValue
are also guaranteed to be true.
These should be moved somewhere like JavaPlatform.
These should be moved somewhere like JavaPlatform.
String representation of symbol's definition key word
String representation of symbol's definition key word
The string discriminator of this symbol; useful for debugging
The string discriminator of this symbol; useful for debugging
For a lazy value, its lazy accessor.
For a lazy value, its lazy accessor. NoSymbol for all others.
If this is a lazy value, the lazy accessor; otherwise this symbol.
If this is a lazy value, the lazy accessor; otherwise this symbol.
For a module class: its linked class For a plain class: the module class of its linked module.
For a module class: its linked class For a plain class: the module class of its linked module.
class Foo <-- linkedClassOfClass --> class Foo$
String representation of location, plus a preposition.
String representation of location, plus a preposition. Doesn't do much, for backward compatibility reasons.
The method or class which logically encloses the current symbol.
The method or class which logically encloses the current symbol. If the symbol is defined in the initialization part of a template this is the template's primary constructor, otherwise it is the physically enclosing method or class.
Example 1:
def f() { val x = { def g() = ...; g() } }
In this case the owner chain of g
is x
, followed by f
and
g.logicallyEnclosingMember == f
.
Example 2:
class C { def <init> = { ... } val x = { def g() = ...; g() } } }
In this case the owner chain of g
is x
, followed by C
but
g.logicallyEnclosingMember is the primary constructor symbol <init>
(or, for traits: $init
) of C
.
Remove private modifier from symbol sym
s definition.
Remove private modifier from symbol sym
s definition. If sym
is a
is not a constructor nor a static module rename it by expanding its name to avoid name clashes
the fully qualified name of this class will be appended if name expansion is needed
Remove any access boundary and clear flags PROTECTED | PRIVATE.
Remove any access boundary and clear flags PROTECTED | PRIVATE.
Adds the interface scala.
Adds the interface scala.Serializable to the parents of a ClassInfoType. Note that the tree also has to be updated accordingly.
If this is a NoSymbol, returns NoSymbol, otherwise
returns the result of applying f
to this symbol.
The non-private member of site
whose type and name match the type of this symbol.
The non-private member of site
whose type and name match the type of this symbol.
The non-private symbol whose type matches the type of this symbol in in given class.
The non-private symbol whose type matches the type of this symbol in in given class.
The class containing the symbol's definition
The base type from which member types are computed
The directly or indirectly inherited mixins of this class except for mixin classes inherited by the superclass.
The directly or indirectly inherited mixins of this class except for mixin classes inherited by the superclass. Mixin classes appear in linearization order.
Modifies this symbol's info in place.
Modifies this symbol's info in place.
The module class corresponding to this module.
The module class corresponding to this module.
The name of the symbol as a member of the Name
type.
The name of the symbol as a member of the Name
type.
String representation of symbol's simple name.
String representation of symbol's simple name. If !settings.debug translates expansions of operators back to operator symbol. E.g. $eq => =. If settings.uniqid, adds id. If settings.Yshowsymkinds, adds abbreviated symbol kind.
Equivalent to !(this eq that)
.
Equivalent to !(this eq that)
.
true
if the argument is not a reference to the receiver object; false
otherwise.
Is this symbol a trait which needs an implementation class?
Is this symbol a trait which needs an implementation class?
Whether this symbol needs nme.
Whether this symbol needs nme.MODULE_SUFFIX_STRING (aka $) appended on the java platform.
Symbol of an abstract type type T >: .
Symbol of an abstract type type T >: ... <: ...
Symbol of a type definition type T = .
Symbol of a type definition type T = ...
Instance constructor with info set.
Instance constructor with info set.
A new class with its info set to a ClassInfoType with given scope and parents.
A new class with its info set to a ClassInfoType with given scope and parents.
Propagates ConstrFlags (JAVA, specifically) from owner to constructor.
Propagates ConstrFlags (JAVA, specifically) from owner to constructor.
Symbol of an existential type T forSome { .
Symbol of an existential type T forSome { ... }
Create a new existential type skolem with this symbol its owner, based on the given symbol and origin.
Create a new existential type skolem with this symbol its owner, based on the given symbol and origin.
Create a new getter for current symbol (which must be a field)
Create a new getter for current symbol (which must be a field)
Create local dummy for template (owner of local blocks)
Create local dummy for template (owner of local blocks)
type relative to which alternatives are seen. for instance: class C[T] { def m(x: T): T def m'(): T } val v: C[Int]
Then v.m has symbol TermSymbol(flags = {OVERLOADED}, tpe = OverloadedType(C[Int], List(m, m'))) You recover the type of m doing a
m.tpe.asSeenFrom(pre, C) (generally, owner of m, which is C here).
or:
pre.memberType(m)
Refinement types P { val x: String; type T <: Number } also have symbols, they are refinementClasses
Refinement types P { val x: String; type T <: Number } also have symbols, they are refinementClasses
Static constructor with info set.
Static constructor with info set.
Synthetic value parameter when parameter symbol is not available.
Synthetic value parameter when parameter symbol is not available. Calling this method multiple times will re-use the same parameter name.
Synthetic value parameters when parameter symbols are not available.
Synthetic value parameters when parameter symbols are not available. Calling this method multiple times will re-use the same parameter names.
Synthetic value parameters when parameter symbols are not available
Synthetic value parameters when parameter symbols are not available
Symbol of a type parameter
Symbol of a type parameter
Type skolems are type parameters seen from the inside
Assuming a polymorphic method m[T], its type is a PolyType which has a TypeParameter
with name T
in its typeParams list.
Type skolems are type parameters seen from the inside
Assuming a polymorphic method m[T], its type is a PolyType which has a TypeParameter
with name T
in its typeParams list. While type checking the parameters, result type and
body of the method, there's a local copy of T
which is a TypeSkolem.
Equivalent to allOverriddenSymbols.
Equivalent to allOverriddenSymbols.head (or NoSymbol if no overrides) but more efficient.
Wakes up a single thread that is waiting on the receiver object's monitor.
Wakes up a single thread that is waiting on the receiver object's monitor.
not specified by SLS as a member of AnyRef
Wakes up all threads that are waiting on the receiver object's monitor.
Wakes up all threads that are waiting on the receiver object's monitor.
not specified by SLS as a member of AnyRef
.
The place where this symbol has been spawned
The place where this symbol has been spawned
Return the original enclosing method of this symbol.
Return the original enclosing method of this symbol. It should return the same thing as enclMethod when called before lambda lift, but it preserves the original nesting when called afterwards.
This method is NOT available in the presentation compiler run. The originalOwner map is not populated for memory considerations (the symbol may hang on to lazy types and in turn to whole (outdated) compilation units.
If this symbol has an expanded name, its original name, otherwise its name itself.
If this symbol has an expanded name, its original name, otherwise its name itself.
expandName
The class that is logically an outer class of given clazz
.
The class that is logically an outer class of given clazz
.
This is the enclosing class, except for classes defined locally to constructors,
where it is the outer class of the enclosing class.
For an outer accessor: The class from which the outer originates.
For an outer accessor: The class from which the outer originates. For all other symbols: NoSymbol
The symbol, in class ofclazz
, that is overridden by this symbol.
The symbol, in class ofclazz
, that is overridden by this symbol.
is a base class of this symbol's owner.
The symbol overriding this symbol in given subclass ofclazz
.
The symbol overriding this symbol in given subclass ofclazz
.
is a subclass of this symbol's owner
The owner of this symbol.
The owner of this symbol. This is the symbol
that directly contains the current symbol's definition.
The NoSymbol
symbol does not have an owner, and calling this method
on one causes an internal error.
The owner of the Scala root class scala.reflect.api.mirror.RootClass
and the Scala root object scala.reflect.api.mirror.RootPackage is NoSymbol
.
Every other symbol has a chain of owners that ends in
scala.reflect.api.mirror.RootClass.
For RootClass, this is EmptyPackageClass.
For RootClass, this is EmptyPackageClass. For all other symbols, the symbol itself.
String representation of location.
String representation of location.
The sequence number of this parameter symbol among all type and value parameters of symbol's owner.
The sequence number of this parameter symbol among all type and value parameters of symbol's owner. -1 if symbol does not appear among the parameters of its owner.
The value parameter sections of this symbol.
The value parameter sections of this symbol.
The position of this symbol
The primary constructor of a class.
The primary constructor of a class.
Access level encoding: there are three scala flags (PRIVATE, PROTECTED, and LOCAL) which combine with value privateWithin (the "foo" in private[foo]) to define from where an entity can be accessed.
Access level encoding: there are three scala flags (PRIVATE, PROTECTED, and LOCAL) which combine with value privateWithin (the "foo" in private[foo]) to define from where an entity can be accessed. The meanings are as follows:
PRIVATE access restricted to class only. PROTECTED access restricted to class and subclasses only. LOCAL can only be set in conjunction with PRIVATE or PROTECTED. Further restricts access to the same object instance.
In addition, privateWithin can be used to set a visibility barrier. When set, everything contained in the named enclosing package or class has access. It is incompatible with PRIVATE or LOCAL, but is additive with PROTECTED (i.e. if either the flags or privateWithin allow access, then it is allowed.)
The java access levels translate as follows:
java private: hasFlag(PRIVATE) && !hasAccessBoundary java package: !hasFlag(PRIVATE | PROTECTED) && (privateWithin == enclosing package) java protected: hasFlag(PROTECTED) && (privateWithin == enclosing package) java public: !hasFlag(PRIVATE | PROTECTED) && !hasAccessBoundary
Return info without checking for initialization or completing
Return info without checking for initialization or completing
Reset symbol to initial state
Reset symbol to initial state
Default implementation calls the generic string function, which will print overloaded flags as <flag1/flag2/flag3>.
Default implementation calls the generic string function, which will print overloaded flags as <flag1/flag2/flag3>. Subclasses of Symbol refine.
Recursively assemble all children of this symbol.
Recursively assemble all children of this symbol.
The String used to order otherwise identical sealed symbols.
The String used to order otherwise identical sealed symbols. This uses data which is stable across runs and variable classpaths (the initial Name) before falling back on id, which varies depending on exactly when a symbol is loaded.
Set initial info.
Set initial info.
Set the info and enter this symbol into the owner's scope.
Set the info and enter this symbol into the owner's scope.
The setter of this value or getter definition, or NoSymbol if none exists
The setter of this value or getter definition, or NoSymbol if none exists
The simple name of this Symbol
The simple name of this Symbol
If this is a constructor, its owner: otherwise this.
If this is a constructor, its owner: otherwise this.
If this is a package object or its implementing class, its owner: otherwise this.
If this is a package object or its implementing class, its owner: otherwise this.
The module corresponding to this module class (note that this is not updated when a module is cloned), or NoSymbol if this is not a ModuleClass.
The module corresponding to this module class (note that this is not updated when a module is cloned), or NoSymbol if this is not a ModuleClass.
Substitute second list of symbols for first in current info.
Substitute second list of symbols for first in current info.
.
The superclass of this class.
The superclass of this class.
The symbol accessed by a super in the definition of this symbol when
seen from class base
.
The symbol accessed by a super in the definition of this symbol when
seen from class base
. This symbol is always concrete.
pre: this.owner
is in the base class sequence of base
.
A tag which (in the ideal case) uniquely identifies class symbols
A tag which (in the ideal case) uniquely identifies class symbols
The self symbol (a TermSymbol) of a class with explicit self type, or else the symbol itself (a TypeSymbol).
The self symbol (a TermSymbol) of a class with explicit self type, or else the symbol itself (a TypeSymbol).
WARNING: you're probably better off using typeOfThis, as it's more uniform across classes with and without self variables.
Example by Paul: scala> trait Foo1 { } scala> trait Foo2 { self => } scala> intp("Foo1").thisSym res0: $r.intp.global.Symbol = trait Foo1
scala> intp("Foo2").thisSym res1: $r.intp.global.Symbol = value self
Martin says: The reason thisSym' is
this' is so that thisType can be this.thisSym.tpe.
It's a trick to shave some cycles off.
Morale: DO: if (clazz.typeOfThis.typeConstructor ne clazz.typeConstructor) ... DON'T: if (clazz.thisSym ne clazz) ...
If symbol is a class, the type this.type
in this class,
otherwise NoPrefix
.
If symbol is a class, the type this.type
in this class,
otherwise NoPrefix
.
We always have: thisType <:< typeOfThis
Symbols of any @throws annotations on this symbol.
Symbols of any @throws annotations on this symbol.
If this symbol is an implementation class, its interface, otherwise the symbol itself The method follows two strategies to determine the interface.
If this symbol is an implementation class, its interface, otherwise the symbol itself The method follows two strategies to determine the interface.
String representation, including symbol's kind e.
Get type.
Get type. The type of a symbol is: for a type symbol, the type corresponding to the symbol itself,
The type constructor of a symbol is: For a type symbol, the type corresponding to the symbol itself, excluding parameters.
The type constructor of a symbol is: For a type symbol, the type corresponding to the symbol itself, excluding parameters. Not applicable for term symbols.
The type of this
in a class, or else the type of the symbol itself.
The type of this
in a class, or else the type of the symbol itself.
The type parameters of this symbol.
The type parameters of this symbol. assumption: if a type starts out as monomorphic, it will not acquire type parameters later.
The type signature of this symbol.
The type signature of this symbol.
Note if the symbol is a member of a class, one almost always is interested
in typeSignatureIn
with a site type instead.
The type signature of this symbol seen as a member of given type site
.
The type signature of this symbol seen as a member of given type site
.
If this symbol is an existential skolem the location (a Tree or null) where it was unpacked.
If this symbol is an existential skolem the location (a Tree or null) where it was unpacked. Resulttype is AnyRef because trees are not visible here.
The type parameters of this symbol, without ensuring type completion.
The type parameters of this symbol, without ensuring type completion. assumption: if a type starts out as monomorphic, it will not acquire type parameters later.
Set new info valid from start of this phase.
Set new info valid from start of this phase.
The valus this symbol refers to
The valus this symbol refers to
The variance of this symbol as an integer
The variance of this symbol as an integer
String representation of symbol's variance
String representation of symbol's variance
(freeTermSymbol: StringAdd).self
(freeTermSymbol: StringFormat).self
(Since version 2.10.0) Use flagString
(Since version 2.10.0) Use hasDefault
(Since version 2.10.0) Use flagString(mask)
(Since version 2.10.0) Use isTrait
(Since version 2.10.0) Use isValueParameter or isTypeParameter
(Since version 2.10.0) Use the other signature
(Since version 2.10.0) Use the other signature
(Since version 2.10.0) Use the other signature
(Since version 2.10.0) Use the other signature
(Since version 2.10.0) Use the other signature
(Since version 2.10.0) Use the other signature
(Since version 2.10.0) Use the other signature
(Since version 2.10.0) Use the other signature
(Since version 2.10.0) Use associatedFile_= instead
Kept for source compatibility with 2.
Kept for source compatibility with 2.9. Scala IDE for Eclipse relies on this.
(Since version 2.10.0) Use enclosingTopLevelClass
(freeTermSymbol: ArrowAssoc[FreeTermSymbol]).x
(Since version 2.10.0) Use leftOfArrow
instead
(freeTermSymbol: Ensuring[FreeTermSymbol]).x
(Since version 2.10.0) Use resultOfEnsuring
instead
The abstract type of free terms introduced by reification