Reflection
extends ObjectTASTy Reflect
Type hierarchy
+- Tree -+- PackageClause
+- Import
+- Statement -+- Definition --+- PackageDef
| | +- ClassDef
| | +- TypeDef
| | +- DefDef
| | +- ValDef
| |
| +- Term --------+- Ref -+- Ident
| | +- Select
| |
| +- Literal
| +- This
| +- New
| +- NamedArg
| +- Apply
| +- TypeApply
| +- Super
| +- Typed
| +- Assign
| +- Block
| +- Closure
| +- If
| +- Match
| +- GivenMatch
| +- Try
| +- Return
| +- Repeated
| +- Inlined
| +- SelectOuter
| +- While
|
|
+- TypeTree ----+- Inferred
| +- TypeIdent
| +- TypeSelect
| +- Projection
| +- Singleton
| +- Refined
| +- Applied
| +- Annotated
| +- MatchTypeTree
| +- ByName
| +- LambdaTypeTree
| +- TypeBind
| +- TypeBlock
|
+- TypeBoundsTree
+- WildcardTypeTree
|
+- CaseDef
|
+- TypeCaseDef
+- Bind
+- Unapply
+- Alternatives
+- NoPrefix
+- TypeOrBounds -+- TypeBounds
|
+- Type -------+- ConstantType
+- TermRef
+- TypeRef
+- SuperType
+- Refinement
+- AppliedType
+- AnnotatedType
+- AndType
+- OrType
+- MatchType
+- ByNameType
+- ParamRef
+- ThisType
+- RecursiveThis
+- RecursiveType
+- LambdaType[ParamInfo <: TypeOrBounds] -+- MethodType
+- PolyType
+- TypeLambda
+- ImportSelector -+- SimpleSelector
+- RenameSelector
+- OmitSelector
+- Id
+- Signature
+- Position
+- Comment
+- Constant
+- Symbol
+- Flags
Supertypes
ObjectConstructors
Reflection
( internal: CompilerInterface )Members
Lambda
A lambda (...) => ...
in the source code is represented as
a local method and a closure:
{ def m(...) = ... closure(m) }
A lambda (...) => ...
in the source code is represented as
a local method and a closure:
{ def m(...) = ... closure(m) }
NamedArg
Scala named argument x = y
in argument position
Scala named argument x = y
in argument position
StandardSymbols
Defines standard symbols (and types via its base trait).
Defines standard symbols (and types via its base trait).
defn
A value containing all standard definitions in [[DefinitionsAPI]]
A value containing all standard definitions in [[DefinitionsAPI]]
Alternatives
= AlternativesPattern representing X | Y | ...
alternatives.
Pattern representing X | Y | ...
alternatives.
Annotated
= AnnotatedType tree representing an annotated type
Type tree representing an annotated type
AnnotatedType
= AnnotatedTypeA type with an anottation T @foo
A type with an anottation T @foo
Applied
= AppliedType tree representing a type application
Type tree representing a type application
AppliedType
= AppliedTypeA higher kinded type applied to some types T[U]
A higher kinded type applied to some types T[U]
Apply
= ApplyTree an application of arguments. It represents a single list of arguments, multiple argument lists will have nested Apply
s
Tree an application of arguments. It represents a single list of arguments, multiple argument lists will have nested Apply
s
Assign
= AssignTree representing an assignment x = y
in the source code
Tree representing an assignment x = y
in the source code
Block
= BlockTree representing a block { ... }
in the source code
Tree representing a block { ... }
in the source code
ByName
= ByNameType tree representing a by name parameter
Type tree representing a by name parameter
CaseDef
= CaseDefBranch of a pattern match or catch clause
Branch of a pattern match or catch clause
ClassDef
= ClassDefTree representing a class definition. This includes annonymus class definitions and the class of a module object
Tree representing a class definition. This includes annonymus class definitions and the class of a module object
Closure
= ClosureA lambda (...) => ...
in the source code is represented as
a local method and a closure:
{ def m(...) = ... closure(m) }
A lambda (...) => ...
in the source code is represented as
a local method and a closure:
{ def m(...) = ... closure(m) }
Constant
= ConstantConstant value represented as the constant itself
Constant value represented as the constant itself
ConstantType
= ConstantTypeA singleton type representing a known constant value
A singleton type representing a known constant value
DefDef
= DefDefTree representing a method definition in the source code
Tree representing a method definition in the source code
Definition
= DefinitionTree representing a definition in the source code. It can be PackageDef
, ClassDef
, TypeDef
, DefDef
or ValDef
Tree representing a definition in the source code. It can be PackageDef
, ClassDef
, TypeDef
, DefDef
or ValDef
Ident
= IdentTree representing a reference to definition with a given name
Tree representing a reference to definition with a given name
If
= IfTree representing an if/then/else if (...) ... else ...
in the source code
Tree representing an if/then/else if (...) ... else ...
in the source code
Import
= ImportTree representing an import in the source code
Tree representing an import in the source code
ImportSelector
= ImportSelectorImport selectors:
* SimpleSelector: .bar
in import foo.bar
* RenameSelector: .{bar => baz}
in import foo.{bar => baz}
* OmitSelector: .{bar => _}
in impo...
Import selectors:
* SimpleSelector: .bar
in import foo.bar
* RenameSelector: .{bar => baz}
in import foo.{bar => baz}
* OmitSelector: .{bar => _}
in import foo.{bar => _}
Inferred
= InferredType tree representing an inferred type
Type tree representing an inferred type
Inlined
= InlinedTree representing the scope of an inlined tree
Tree representing the scope of an inlined tree
LambdaType
= LambdaType[ParamInfo]Common abstraction for lambda types (MethodType, PolyType and TypeLambda).
Common abstraction for lambda types (MethodType, PolyType and TypeLambda).
LambdaTypeTree
= LambdaTypeTreeType tree representing a lambda abstraction type
Type tree representing a lambda abstraction type
Literal
= LiteralTree representing a literal value in the source code
Tree representing a literal value in the source code
Match
= MatchTree representing a pattern match x match { ... }
in the source code
Tree representing a pattern match x match { ... }
in the source code
MatchType
= MatchTypeType match T match { case U => ... }
Type match T match { case U => ... }
MatchTypeTree
= MatchTypeTreeType tree representing a type match
Type tree representing a type match
MethodType
= MethodTypeType of the definition of a method taking a single list of parameters. It's return type may be a MethodType.
Type of the definition of a method taking a single list of parameters. It's return type may be a MethodType.
NamedArg
= NamedArgTree representing an argument passed with an explicit name. Such as arg1 = x
in foo(arg1 = x)
Tree representing an argument passed with an explicit name. Such as arg1 = x
in foo(arg1 = x)
PackageClause
= PackageClauseTree representing a pacakage clause in the source code
Tree representing a pacakage clause in the source code
PackageDef
= PackageDefTree representing a package definition. This includes definitions in all source files
Tree representing a package definition. This includes definitions in all source files
PolyType
= PolyTypeType of the definition of a method taking a list of type parameters. It's return type may be a MethodType.
Type of the definition of a method taking a list of type parameters. It's return type may be a MethodType.
Projection
= ProjectionType tree representing a selection of definition with a given name on a given type prefix
Type tree representing a selection of definition with a given name on a given type prefix
RecursiveThis
= RecursiveThisA type that is recursively defined this
A type that is recursively defined this
RecursiveType
= RecursiveTypeA type that is recursively defined
A type that is recursively defined
Ref
= RefTree representing a reference to definition
Tree representing a reference to definition
Refined
= RefinedType tree representing a type refinement
Type tree representing a type refinement
Refinement
= RefinementA type with a type refinement T { type U }
A type with a type refinement T { type U }
Repeated
= RepeatedTree representing a variable argument list in the source code
Tree representing a variable argument list in the source code
Return
= ReturnTree representing a return
in the source code
Tree representing a return
in the source code
Select
= SelectTree representing a selection of definition with a given name on a given prefix
Tree representing a selection of definition with a given name on a given prefix
SelectOuter
= SelectOuterTree representing a selection of definition with a given name on a given prefix and number of nested scopes of inlined trees
Tree representing a selection of definition with a given name on a given prefix and number of nested scopes of inlined trees
Singleton
= SingletonType tree representing a singleton type
Type tree representing a singleton type
Statement
= StatementTree representing a statement in the source code
Tree representing a statement in the source code
Super
= SuperTree representing super
in the source code
Tree representing super
in the source code
Symbol
= SymbolSymbol of a definition. Then can be compared with == to know if the definition is the same.
Symbol of a definition. Then can be compared with == to know if the definition is the same.
Term
= TermTree representing an expression in the source code
Tree representing an expression in the source code
This
= ThisTree representing this
in the source code
Tree representing this
in the source code
Tree
= TreeTree representing code written in the source
Tree representing code written in the source
Try
= TryTree representing a try catch try x catch { ... } finally { ... }
in the source code
Tree representing a try catch try x catch { ... } finally { ... }
in the source code
TypeApply
= TypeApplyTree an application of type arguments
Tree an application of type arguments
TypeBind
= TypeBindType tree representing a type binding
Type tree representing a type binding
TypeBlock
= TypeBlockType tree within a block with aliases { type U1 = ... ; T[U1, U2] }
Type tree within a block with aliases { type U1 = ... ; T[U1, U2] }
TypeBoundsTree
= TypeBoundsTreeType tree representing a type bound written in the source
Type tree representing a type bound written in the source
TypeDef
= TypeDefTree representing a type (parameter or member) definition in the source code
Tree representing a type (parameter or member) definition in the source code
TypeIdent
= TypeIdentType tree representing a reference to definition with a given name
Type tree representing a reference to definition with a given name
TypeLambda
= TypeLambdaType of the definition of a type lambda taking a list of type parameters. It's return type may be a TypeLambda.
Type of the definition of a type lambda taking a list of type parameters. It's return type may be a TypeLambda.
TypeSelect
= TypeSelectType tree representing a selection of definition with a given name on a given term prefix
Type tree representing a selection of definition with a given name on a given term prefix
TypeTree
= TypeTreeType tree representing a type written in the source
Type tree representing a type written in the source
Typed
= TypedTree representing a type ascription x: T
in the source code
Tree representing a type ascription x: T
in the source code
Unapply
= UnapplyPattern representing a Xyz(...)
unapply.
Pattern representing a Xyz(...)
unapply.
ValDef
= ValDefTree representing a value definition in the source code This inclues val
, lazy val
, var
, object
and parameter defintions.
Tree representing a value definition in the source code This inclues val
, lazy val
, var
, object
and parameter defintions.
WildcardTypeTree
= WildcardTypeTreeType tree representing wildcard type bounds written in the source.
The wildcard type _
(for example in in List[_]
) will be a type tree that
represents a...
Type tree representing wildcard type bounds written in the source.
The wildcard type _
(for example in in List[_]
) will be a type tree that
represents a type but has TypeBound
a inside.
MatchCaseType
( implicit ctx: Context ) : TypeAn accessor for scala.internal.MatchCase[_,_]
, the representation of a MatchType
case.
An accessor for scala.internal.MatchCase[_,_]
, the representation of a MatchType
case.
error
( msg: => String , pos: Position ) ( implicit ctx: Context ) : UnitEmits an error message
Emits an error message
error
( msg: => String , source: SourceFile , start: Int , end: Int ) ( implicit ctx: Context ) : UnitEmits an error at a specific range of a file
Emits an error at a specific range of a file
given_IsInstanceOf_AmbiguousImplicits
( implicit ctx: Context ) : ClassTag[AmbiguousImplicits]given_IsInstanceOf_AnnotatedType
( implicit ctx: Context ) : ClassTag[AnnotatedType]given_IsInstanceOf_DivergingImplicit
( implicit ctx: Context ) : ClassTag[DivergingImplicit]given_IsInstanceOf_ImplicitSearchFailure
( implicit ctx: Context ) : ClassTag[ImplicitSearchFailure]given_IsInstanceOf_ImplicitSearchSuccess
( implicit ctx: Context ) : ClassTag[ImplicitSearchSuccess]given_IsInstanceOf_LambdaTypeTree
( implicit ctx: Context ) : ClassTag[LambdaTypeTree]given_IsInstanceOf_MatchTypeTree
( implicit ctx: Context ) : ClassTag[MatchTypeTree]given_IsInstanceOf_NoMatchingImplicits
( implicit ctx: Context ) : ClassTag[NoMatchingImplicits]given_IsInstanceOf_PackageClause
( implicit ctx: Context ) : ClassTag[PackageClause]given_IsInstanceOf_RecursiveThis
( implicit ctx: Context ) : ClassTag[RecursiveThis]given_IsInstanceOf_RecursiveType
( implicit ctx: Context ) : ClassTag[RecursiveType]given_IsInstanceOf_RenameSelector
( implicit ctx: Context ) : ClassTag[RenameSelector]given_IsInstanceOf_SimpleSelector
( implicit ctx: Context ) : ClassTag[SimpleSelector]given_IsInstanceOf_TypeBoundsTree
( implicit ctx: Context ) : ClassTag[TypeBoundsTree]given_IsInstanceOf_WildcardTypeTree
( implicit ctx: Context ) : ClassTag[WildcardTypeTree]let
( rhs: Term ) ( body: Ident => Term ) ( implicit ctx: Context ) : TermBind the rhs
to a val
and use it in body
Bind the rhs
to a val
and use it in body
lets
( terms: List[Term] ) ( body: List[Term] => Term ) ( implicit ctx: Context ) : TermBind the given terms
to names and use them in the body
Bind the given terms
to names and use them in the body
rootPosition
: PositionRoot position of this tasty context. For macros it corresponds to the expansion site.
Root position of this tasty context. For macros it corresponds to the expansion site.
typeOf
[T] ( implicit qtype: Type[T] , ctx: Context ) : TypeReturns the type (Type) of T
Returns the type (Type) of T
warning
( msg: => String , pos: Position ) ( implicit ctx: Context ) : UnitEmits an error message
Emits an error message
warning
( msg: => String , source: SourceFile , start: Int , end: Int ) ( implicit ctx: Context ) : UnitEmits a warning at a specific range of a file
Emits a warning at a specific range of a file