tastyquery
Members list
Packages
Type members
Classlikes
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
Annotations.type
In-memory representation of the contents of classpaths.
In-memory representation of the contents of classpaths.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
Classpaths.type
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
Constants.type
Container for top-level definitions related to contexts.
Container for top-level definitions related to contexts.
See Contexts.Context for more details.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
Contexts.type
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
Exceptions.type
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
Modifiers.type
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
Signatures.type
Attributes
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
Attributes
- Companion
- class
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
SourceFile.type
Source language of a symbol.
Source language of a symbol.
Attributes
- Supertypes
-
trait Enumtrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
Attributes
- Companion
- class
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
SourcePosition.type
Symbols for all kinds of definitions in Scala programs.
Symbols for all kinds of definitions in Scala programs.
Every definition, like classes, defs, types and type parameters, is associated with a Symbol. Symbols 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 names.
TypeMemberSymbols exist in 3 flavors, indicated by their typeDef field, of type TypeMemberDefinition:
TypeAlias(alias): type alias of the formtype T = aliasAbstractType(bounds): abstract type member of the formtype T >: bounds.low <: bounds.highOpaqueTypeAlias(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. ClassSymbols 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 TypeSymbols, and a TermName for TermSymbols and PackageSymbols.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
Symbols.type
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
Traversers.type
Types in the Scala type system.
Types in the Scala type system.
Every type from the Scala type system is represented in tasty-query as an instance of Type. That abstract class has a number of subtypes for all the possible "shapes" of types.
For example, a reference to the class scala.Int is represented as
TypeRef(PackageRef("scala"), TypeName("Int"))
Type applications of the form C[T1, ..., Tn] are represented as
AppliedType(typeForC, List(typeForT1, ..., typeForTn))
etc.
The type hierarchy is organized as follows:
TermType a type that can be the type of a term tree
|
+- PackageRef a reference to a package
|
+- TypeOrMethodic a type or a methodic type (e.g., the declared type of a term symbol)
|
+- MethodicType the type of a method with at least one parameter list
| +- MethodType `(termParams): resultType`
| +- PolyType `[TypeParams]: resultType`
|
+- Type
|
+- NamedType designator type
| +- TypeRef type selection of the form `prefix.T`
| +- TermRef term selection of the form `prefix.t`
|
+- AppliedType `C[T1, ..., Tn]`
+- ByNameType type of a by-name parameter `=> T`
+- ThisType `C.this`
+- OrType `A | B`
+- AndType `A & B`
+- TypeLambda `[T1, ..., Tn] => R`
+- TypeParamRef reference to a type parameter of an enclosing `TypeLambda` or `PolyType`
+- TermParamRef reference to a term parameter of an enclosing `MethodType`
+- AnnotatedType `T @annotation`
+- ConstantType literal singleton type, such as `42` or `"foo"`
+- MatchType `T match { case ... }`
|
+- RefinedType refined type
| +- TypeRefinement `P { type T >: L <: H }`
| +- TermRefinement `P { val/def t: T }`
|
+- RecType recursive type that introduces a recursive `this` binding
+- RecThis recursive reference to the `this` of a `RecType`
+- SuperType `super[mix]` (typically used as `prefix` of `NamedType`s)
In addition, Types contains additional categories of things used inside other types:
Prefix prefix of a designator type
+- NoPrefix the empty prefix, for direct designators
+- NonEmptyPrefix
+- PackageRef a reference to a package, for designators of top-level symbols
+- Type a type, for named designators
TypeOrWildcard either a type or a wildcard, used in the type arguments of `AppliedType`
+- Type
+- WildcardTypeArg `? >: L <: H`
TermSelectionType the reference type of an `Ident` or `Select`
+- PackageRef
+- TermRef
All of the above types inherit from TypeMappable, which represents things on which we apply type substitution.
Common shapes of types can be constructed with properties of Symbols.Symbol and with combinator methods on Type:
- typeSymbol.staticRef constructs a
TypeRefto the given statictypeSymbol - termSymbol.staticRef constructs a
TermRefto the given statictermSymbol - packageSymbol.packageRef constructs a
PackageRefof the given package - classSymbol.thisType constructs the
ThisTypeof the givenclassSymbol - typeOrPackage.select(name or symbol) constructs a named designator type
- tpe1.appliedTo(tpe2) constructs the application
tpe1[tpe2](there is an overload that accepts a list of type arguments) - tpe1 | tpe2 constructs a union type
- tpe1 & tpe2 constructs an intersection type
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
Types.type