The type of the symbol name.
The type of the symbol name.
Can be either TermName
or TypeName
depending on whether this is a TermSymbol
or a TypeSymbol
.
Type name namespaces do not intersect with term name namespaces.
This fact is reflected in different types for names of TermSymbol
and TypeSymbol
.
Returns all symbols overriden by this symbol.
Returns all symbols overriden by this symbol.
A list of annotations attached to this Symbol.
A list of annotations attached to this Symbol.
Source file if this symbol is created during this compilation run, or a class file if this symbol is loaded from a *.
Source file if this symbol is created during this compilation run, or a class file if this symbol is loaded from a *.class or *.jar.
The return type is scala.reflect.io.AbstractFile
, which belongs to an experimental part of Scala reflection.
It should not be used unless you know what you are doing. In subsequent releases, this API will be refined
and exposed as a part of scala.reflect.api.
The attachment of the reflection artifact.
The attachment of the reflection artifact.
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 a module: the class with the same name in the same package. For all others: NoSymbol
If this symbol is a skolem, its corresponding type parameter, otherwise the symbol itself.
If this symbol is a skolem, its corresponding type parameter, otherwise the symbol itself.
To quote Martin Odersky, skolems are synthetic type "constants" that are copies of existentially bound or universally bound type variables. E.g. if one is inside the right-hand side of a method:
def foo[T](x: T) = ... foo[List[T]]....
the skolem named T
refers to the unknown type instance of T
when foo
is called. It needs to be different
from the type parameter because in a recursive call as in the foo[List[T]]
above the type parameter gets
substituted with List[T]
, but the type skolem stays what it is.
The other form of skolem is an existential skolem. Say one has a function
def bar(xs: List[T] forSome { type T }) = xs.head
then each occurrence of xs
on the right will have type List[T']
where T'
is a fresh copy of T
.
Filters the underlying alternatives (or a single-element list composed of the symbol itself if the symbol is not overloaded).
Filters the underlying alternatives (or a single-element list composed of the symbol itself if the symbol is not overloaded). Returns an overloaded symbol is there are multiple matches. Returns a NoSymbol if there are no matches.
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.
Is this symbol labelled as "abstract override"?
Is this symbol labelled as "abstract override"?
Does this symbol or its underlying type represent a typechecking error?
Does this symbol or its underlying type represent a typechecking error?
Is this symbol final?
Is this symbol final?
Does this symbol represent an implementation artifact that isn't meant for public use? Examples of such artifacts are erasure bridges and outer fields.
Does this symbol represent an implementation artifact that isn't meant for public use? Examples of such artifacts are erasure bridges and outer fields.
Does this symbol represent an implicit value, definition, class or parameter?
Does this symbol represent an implicit value, definition, class or parameter?
Is this symbol defined by Java?
Is this symbol defined by Java?
Does this symbol represent a local declaration or definition?
Does this symbol represent a local declaration or definition?
If yes, either isPrivate
or isProtected
are guaranteed to be true.
Local symbols can only be accessed from the same object instance.
If yes, privateWithin
might tell more about this symbol's visibility scope.
Is this symbol a macro?
Is this symbol a macro?
Is this symbol overriding something?
Is this symbol overriding something?
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.
Does this symbol represent a package class?
If yes, isClass
is also guaranteed to be true.
Does this symbol represent a package class?
If yes, isClass
is also guaranteed to be true.
Is this symbol a parameter (either a method parameter or a type parameter)?
Is this symbol a parameter (either a method parameter or a type parameter)?
Does this symbol represent a private declaration or definition?
If yes, privateWithin
might tell more about this symbol's visibility scope.
Does this symbol represent a private declaration or definition?
If yes, privateWithin
might tell more about this symbol's visibility scope.
Does this symbol represent a protected declaration or definition?
If yes, privateWithin
might tell more about this symbol's visibility scope.
Does this symbol represent a protected declaration or definition?
If yes, privateWithin
might tell more about this symbol's visibility scope.
Does this symbol represent a public declaration or definition?
Does this symbol represent a public declaration or definition?
Is this symbol a specialized type parameter or a generated specialized member?
Is this symbol a specialized type parameter or a generated specialized member?
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
Does this symbol represent a synthetic (i.
Does this symbol represent a synthetic (i.e. a compiler-generated) entity? Examples of synthetic entities are accessors for vals and vars or mixin constructors in trait implementation classes.
If this is a NoSymbol, returns NoSymbol, otherwise
returns the result of applying f
to this symbol.
If this is a NoSymbol, returns NoSymbol, otherwise
returns the result of applying f
to this symbol.
The name of the symbol as a member of the Name
type.
The name of the symbol as a member of the Name
type.
Provides an alternate if symbol is a NoSymbol.
Provides an alternate if symbol is a NoSymbol.
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.
The position of this symbol.
Set when symbol has a modifier of the form private[X], NoSymbol otherwise.
Set when symbol has a modifier of the form private[X], NoSymbol otherwise.
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: isPrivate && (privateWithin == NoSymbol) java package: !isPrivate && !isProtected && (privateWithin == enclosingPackage) java protected: isProtected && (privateWithin == enclosingPackage) java public: !isPrivate && !isProtected && (privateWithin == NoSymbol)
Update the attachment with the payload of the given class type T
removed.
Update the attachment with the payload of the given class type T
removed.
Returns the reflection artifact itself.
Sets the annotations
of the symbol.
Sets the name
of the symbol.
Sets the privateWithin
of the symbol.
Sets the typeSignature
of the symbol.
Does the same as filter
, but crashes if there are multiple matches.
Does the same as filter
, but crashes if there are multiple matches.
The type signature of this symbol.
The type signature of this symbol.
This method always returns signatures in the most generic way possible, even if the underlying symbol is obtained from an
instantiation of a generic type. For example, signature
of the method def map[B](f: (A) ⇒ B): List[B]
, which refers to the type parameter A
of the declaring class List[A]
,
will always feature A
, regardless of whether map
is loaded from the List[_]
or from List[Int]
. To get a signature
with type parameters appropriately instantiated, one should use typeSignatureIn
.
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
.
Updates the attachment with the payload slot of T added/updated with the provided value.
Updates the attachment with the payload slot of T added/updated with the provided value. Replaces an existing payload of the same type, if exists. Returns the reflection artifact itself.
This symbol cast to a ClassSymbol representing a class or trait.
This symbol cast to a ClassSymbol representing a class or trait.
if isClass
is false.
This symbol cast to a free term symbol.
This symbol cast to a free term symbol.
if isFreeTerm
is false.
This symbol cast to a free type symbol.
This symbol cast to a free type symbol.
if isFreeType
is false.
This symbol cast to a MethodSymbol.
This symbol cast to a MethodSymbol.
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.
if isModule
is false.
This symbol cast to a TermSymbol.
This symbol cast to a TermSymbol.
if isTerm
is false.
This symbol cast to a TypeSymbol.
This symbol cast to a TypeSymbol.
if isType
is false.
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).
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.
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 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.
Used to provide a better error message for asMethod
Used to provide a better error message for asMethod
Does this symbol represent the definition of a term? Note that every symbol is either a term or a type.
Does this symbol represent the definition of a term?
Note that every symbol is either a term or a type.
So for every symbol sym
(except for NoSymbol
),
either sym.isTerm
is true or sym.isType
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
(except for NoSymbol
),
either sym.isTerm
is true or sym.isType
is true.
These methods construct new symbols owned by the current symbol.
These methods enable collections-like operations on symbols.
The extended API of symbols that's supported in macro context universes