Symbols
Symbols for all kinds of definitions in Scala programs.
Every definition, like class
es, def
s, type
s and type parameters, is associated with a Symbol
. Symbol
s are organized in a hierarchy, depending on what kind of definitions they represent.
Symbol
|
+- PackageSymbol any package, including the root package, the empty package, and nested packages
|
+- TermOrTypeSymbol any term or type symbol, i.e., not a package
|
+- TermSymbol any term definition:
| `val`, `var`, `def`, term param, term capture, `object` value
|
+- TypeSymbol any definition for a type
+- ClassSymbol definition for a `class`, `trait`, or the module class of an `object`
+- TypeSymbolWithBounds any other kind of type: `type` definitions, type params, type captures
+- TypeMemberSymbol `type` definition, further refined through its `typeDef`
+- TypeParamSymbol
+- ClassTypeParamSymbol type parameter of a class
+- LocalTypeParamSymbol any other type parameter
Additionally, PackageSymbol
and ClassSymbol
extend DeclaringSymbol
. Declaring symbols are the ones that contain declarations, which can be looked up with their name
s.
TypeMemberSymbol
s exist in 3 flavors, indicated by their typeDef
field, of type TypeMemberDefinition
:
TypeAlias(alias)
: type alias of the formtype T = alias
AbstractType(bounds)
: abstract type member of the formtype T >: bounds.low <: bounds.high
OpaqueTypeAlias(bounds, alias)
: opaque type alias of the formtype T >: bounds.low <: bounds.high = alias
The main property a TermSymbol
is its declaredType
, which is a Type
. All TypeSymbolWithBounds
have bounds
of type TypeBounds
, which are often used as their primary characteristic. ClassSymbol
s are entirely defined by themselves.
With the exception of the root package symbol, all symbols have an owner
which is another Symbol
.
All symbols also have a name
. It is a TypeName
for TypeSymbol
s, and a TermName
for TermSymbol
s and PackageSymbol
s.
Attributes
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
Symbols.type
Members list
Type members
Classlikes
Attributes
- Companion
- object
- Supertypes
-
trait DeclaringSymbolclass TypeSymbolclass TermOrTypeSymbolclass Symbolclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- class
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
ClassSymbol.type
Attributes
- Companion
- object
- Supertypes
-
trait TypeConstructorParamclass TypeParamSymbolclass TypeSymbolWithBoundsclass TypeSymbolclass TermOrTypeSymbolclass Symbolclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- class
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
ClassTypeParamSymbol.type
Attributes
- Supertypes
- Known subtypes
-
class ClassSymbolclass PackageSymbol
Attributes
- Companion
- object
- Supertypes
-
class TypeParamSymbolclass TypeSymbolWithBoundsclass TypeSymbolclass TermOrTypeSymbolclass Symbolclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- class
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
LocalTypeParamSymbol.type
Attributes
- Companion
- object
- Supertypes
Attributes
- Companion
- class
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
PackageSymbol.type
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
trait DeclaringSymbolclass ClassSymbolclass PackageSymbolclass TermOrTypeSymbolclass TermSymbolclass TypeSymbolclass TypeSymbolWithBoundsclass TypeMemberSymbolclass TypeParamSymbolclass ClassTypeParamSymbolclass LocalTypeParamSymbolShow all
Attributes
- Supertypes
- Known subtypes
-
class TermSymbolclass TypeSymbolclass ClassSymbolclass TypeSymbolWithBoundsclass TypeMemberSymbolclass TypeParamSymbolclass ClassTypeParamSymbolclass LocalTypeParamSymbolShow all
Attributes
- Companion
- object
- Supertypes
Attributes
- Companion
- class
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
TermSymbol.type
Attributes
- Supertypes
-
trait Enumtrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- object
- Supertypes
-
class TypeSymbolWithBoundsclass TypeSymbolclass TermOrTypeSymbolclass Symbolclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- class
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
TypeMemberSymbol.type
Attributes
- Supertypes
-
class TypeSymbolWithBoundsclass TypeSymbolclass TermOrTypeSymbolclass Symbolclass Objecttrait Matchableclass AnyShow all
- Known subtypes
-
class ClassTypeParamSymbolclass LocalTypeParamSymbol
Attributes
- Supertypes
- Known subtypes
-
class ClassSymbolclass TypeSymbolWithBoundsclass TypeMemberSymbolclass TypeParamSymbolclass ClassTypeParamSymbolclass LocalTypeParamSymbolShow all
Attributes
- Supertypes
-
class TypeSymbolclass TermOrTypeSymbolclass Symbolclass Objecttrait Matchableclass AnyShow all
- Known subtypes