Alternatives of patterns.
Alternatives of patterns.
Eliminated by compiler phases Eliminated by compiler phases patmat (in the new pattern matcher of 2.10) or explicitouter (in the old pre-2.10 pattern matcher), except for occurrences in encoded Switch stmt (i.e. remaining Match(CaseDef(...)))
The API that all alternatives support
An extractor class to create and pattern match with syntax Alternative(trees)
.
A tree that has an annotation attached to it.
A tree that has an annotation attached to it. Only used for annotated types and annotation ascriptions, annotations on definitions are stored in the Modifiers. Eliminated by typechecker (typedAnnotated), the annotations are then stored in an AnnotatedType.
The API that all annotateds support
An extractor class to create and pattern match with syntax Annotated(annot, arg)
.
A type carrying some annotations.
A type carrying some annotations. Created by the typechecker when eliminating Annotated trees (see typedAnnotated).
The API that all annotated types support.
An extractor class to create and pattern match with syntax
AnnotatedType(annotations, underlying, selfsym)
.
The API of Annotation
instances.
An additional checker for annotations on types.
An additional checker for annotations on types. Typically these are registered by compiler plugins with the addAnnotationChecker method.
An extractor class to create and pattern match with syntax Annotation(tpe, scalaArgs, javaArgs)
.
Typed information about an annotation.
Typed information about an annotation. It can be attached to either a symbol or an annotated type.
Annotations are written to the classfile as Java annotations
if atp
conforms to ClassfileAnnotation
(the classfile parser adds
this interface to any Java annotation class).
Annotations are pickled (written to scala symtab attribute in the
classfile) if atp
inherits form StaticAnnotation
.
args
stores arguments to Scala annotations, represented as typed
trees. Note that these trees are not transformed by any phases
following the type-checker.
assocs
stores arguments to classfile annotations as name-value pairs.
A class remembering a type instantiation for some a set of overloaded polymorphic symbols.
A class remembering a type instantiation for some a set of overloaded
polymorphic symbols.
Not used after phase typer
.
Applied type <tpt> [ <args> ], eliminated by RefCheck
Applied type <tpt> [ <args> ], eliminated by RefCheck
The API that all applied type trees support
An extractor class to create and pattern match with syntax AppliedTypeTree(tpt, args)
.
Precondition: zipped params/args nonEmpty.
Precondition: zipped params/args nonEmpty. (Size equivalence enforced structurally.)
Value application
Value application
The API that all applies support
An extractor class to create and pattern match with syntax Apply(fun, args)
.
Represents an array of classfile annotation arguments
Represents an array of classfile annotation arguments
API of ArrayArgument
instances.
An extractor class to create and pattern match with syntax ArrayArgument(args)
where args
is the argument array.
An array of expressions.
An array of expressions. This AST node needs to be translated in backend. It is used to pass arguments to vararg arguments. Introduced by compiler phase uncurry.
This AST node does not have direct correspondence to Scala code, and is used to pass arguments to vararg arguments. For instance:
printf("%s%d", foo, 42)
Is translated to after compiler phase uncurry to:
Apply( Ident("printf"), Literal("%s%d"), ArrayValue(<Any>, List(Ident("foo"), Literal(42))))
A map to compute the asSeenFrom method
A map to compute the asSeenFrom method
Assignment
Assignment
The API that all assigns support
An extractor class to create and pattern match with syntax Assign(lhs, rhs)
.
Either an assignment or a named argument.
Either an assignment or a named argument. Only appears in argument lists, eliminated by compiler phase typecheck (doTypedApply), resurrected by reifier.
The API that all assigns support
An extractor class to create and pattern match with syntax AssignOrNamedArg(lhs, rhs)
.
Common code between reflect-internal Symbol and Tree related to Attachments.
Common code between reflect-internal Symbol and Tree related to Attachments.
The API of reflection artifacts that support scala.reflect.macros.Attachments.
Note: constructor is protected to force everyone to use the factory method newBaseTypeSeq instead.
Note: constructor is protected to force everyone to use the factory method newBaseTypeSeq instead. This is necessary because when run from reflection every base type sequence needs to have a SynchronizedBaseTypeSeq as mixin.
Bind a variable to a rhs pattern.
Bind a variable to a rhs pattern.
Eliminated by compiler phases patmat (in the new pattern matcher of 2.10) or explicitouter (in the old pre-2.10 pattern matcher).
The API that all binds support
An extractor class to create and pattern match with syntax Bind(name, body)
.
Block of expressions (semicolon separated expressions)
Block of expressions (semicolon separated expressions)
The API that all blocks support
An extractor class to create and pattern match with syntax Block(stats, expr)
.
BoundedWildcardTypes, used only during type inference, are created in two places that I can find:
BoundedWildcardTypes, used only during type inference, are created in two places that I can find:
The API that all this types support.
An extractor class to create and pattern match with syntax BoundedWildcardTypeExtractor(bounds)
with bounds
denoting the type bounds.
Case clause in a pattern match.
Case clause in a pattern match. (except for occurrences in switch statements). Eliminated by compiler phases patmat (in the new pattern matcher of 2.10) or explicitouter (in the old pre-2.10 pattern matcher)
The API that all case defs support
An extractor class to create and pattern match with syntax CaseDef(pat, guard, body)
.
A class definition.
A class definition.
The API that all class defs support
An extractor class to create and pattern match with syntax ClassDef(mods, name, tparams, impl)
.
A class representing a class info
A class representing a class info
The API that all class info types support.
An extractor class to create and pattern match with syntax ClassInfo(parents, decls, clazz)
Here, parents
is the list of parent types of the class, decls
is the scope
containing all declarations in the class, and clazz
is the symbol of the class
itself.
A mirror that reflects the instance parts of a runtime class.
A class for class symbols
A class for class symbols
The API of class symbols.
Arguments to classfile annotations (which are written to bytecode as java annotations) are either:
Arguments to classfile annotations (which are written to bytecode as java annotations) are either:
A map to implement the collect
method.
A map to implement the collect
method.
The type of compilation units.
Compilation unit describes a unit of work of the compilation run.
A common base class for intersection types and class types
A common base class for intersection types and class types
Intersection type <parent1> with .
Intersection type <parent1> with ... with <parentN> { <decls> }, eliminated by RefCheck
The API that all compound type trees support
An extractor class to create and pattern match with syntax CompoundTypeTree(templ)
.
Stores the trees that give rise to a refined type to be used in reification.
Stores the trees that give rise to a refined type to be used in reification.
Unfortunately typed CompoundTypeTree
is lacking essential info, and the reifier cannot use CompoundTypeTree.tpe
.
Therefore we need this hack (see Reshape.toPreTyperTypeTree
for a detailed explanation).
This "virtual" case class represents the reflection interface for literal expressions which can not be further broken down or evaluated, such as "true", "0", "classOf[List]".
This "virtual" case class represents the reflection interface for literal expressions which can not be further broken down or evaluated, such as "true", "0", "classOf[List]". Such values become parts of the Scala abstract syntax tree representing the program. The constants correspond to section 6.24 "Constant Expressions" of the Scala language specification.
Such constants are used to represent literals in abstract syntax trees (the scala.reflect.api.Trees#Literal node) and literal arguments for Java class file annotations (the scala.reflect.api.Annotations#LiteralArgument class).
Constants can be matched against and can be constructed directly, as if they were case classes:
assert(Constant(true).value == true) Constant(true) match { case Constant(s: String) => println("A string: " + s) case Constant(b: Boolean) => println("A boolean value: " + b) case Constant(x) => println("Something else: " + x) }
Constant
instances can wrap certain kinds of these expressions:
Byte
, Short
, Int
, Long
, Float
, Double
, Char
, Boolean
and Unit
) - represented directly as the corresponding typeString
. Class references are represented as instances of scala.reflect.api.Types#Type
(because when the Scala compiler processes a class reference, the underlying runtime class might not yet have
been compiled). To convert such a reference to a runtime class, one should use the runtimeClass
method of a
mirror such as RuntimeMirror
(the simplest way to get such a mirror is using
scala.reflect.runtime.currentMirror
).
Enumeration value references are represented as instances of scala.reflect.api.Symbols#Symbol, which on JVM point to methods that return underlying enum values. To inspect an underlying enumeration or to get runtime value of a reference to an enum, one should use a scala.reflect.api.Mirrors#RuntimeMirror (the simplest way to get such a mirror is again scala.reflect.runtime.package#currentMirror).
Usage example:
enum JavaSimpleEnumeration { FOO, BAR } import java.lang.annotation.*; @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.TYPE}) public @interface JavaSimpleAnnotation { Class<?> classRef(); JavaSimpleEnumeration enumRef(); } @JavaSimpleAnnotation( classRef = JavaAnnottee.class, enumRef = JavaSimpleEnumeration.BAR ) public class JavaAnnottee {}
import scala.reflect.runtime.universe._ import scala.reflect.runtime.{currentMirror => cm} object Test extends App { val jann = typeOf[JavaAnnottee].typeSymbol.annotations(0).javaArgs def jarg(name: String) = jann(newTermName(name)) match { // Constant is always wrapped into a Literal or LiteralArgument tree node case LiteralArgument(ct: Constant) => value case _ => sys.error("Not a constant") } val classRef = jarg("classRef").value.asInstanceOf[Type] // ideally one should match instead of casting println(showRaw(classRef)) // TypeRef(ThisType(), JavaAnnottee, List()) println(cm.runtimeClass(classRef)) // class JavaAnnottee val enumRef = jarg("enumRef").value.asInstanceOf[Symbol] // ideally one should match instead of casting println(enumRef) // value BAR val siblings = enumRef.owner.typeSignature.declarations val enumValues = siblings.filter(sym => sym.isVal && sym.isPublic) println(enumValues) // Scope{ // final val FOO: JavaSimpleEnumeration; // final val BAR: JavaSimpleEnumeration // } // doesn't work because of https://issues.scala-lang.org/browse/SI-6459 // val enumValue = mirror.reflectField(enumRef.asTerm).get val enumClass = cm.runtimeClass(enumRef.owner.asClass) val enumValue = enumClass.getDeclaredField(enumRef.name.toString).get(null) println(enumValue) // BAR }
The API of Constant instances.
An extractor class to create and pattern match with syntax Constant(value)
where value
is the Scala value of the constant.
A class representing a constant type.
A class representing a constant type.
The API that all constant types support.
An extractor class to create and pattern match with syntax ConstantType(constant)
Here, constant
is the constant value represented by the type.
A map to implement the contains
method.
A map to implement the contains
method.
A map to implement the contains
method.
A map to implement the contains
method.
An exception for cyclic references of symbol definitions
An exception for cyclic references of symbol definitions
A binder defining data associated with De Bruijn indices.
A binder defining data associated with De Bruijn indices. Only used as a serialization format.
A De Bruijn index referring to a previous type argument.
A De Bruijn index referring to a previous type argument. Only used as a serialization format.
A method or macro definition.
A method or macro definition.
The API that all def defs support
An extractor class to create and pattern match with syntax DefDef(mods, name, tparams, vparamss, tpt, rhs)
.
A tree which defines a symbol-carrying entity.
A tree which defines a symbol-carrying entity.
The API that all def trees support
Defines standard symbols (and types via its base trait).
A temporary type representing the erasure of a user-defined value type.
A temporary type representing the erasure of a user-defined value type. Created during phase erasure, eliminated again in posterasure.
The error scope.
The error scope.
Used by existentialAbstraction.
Used by existentialAbstraction.
The ExistentialType
type signature is used for existential types and
wildcard types.
The ExistentialType
type signature is used for existential types and
wildcard types.
The API that all existential types support.
An extractor class to create and pattern match with syntax
ExistentialType(quantified, underlying)
.
Existential type tree node
Existential type tree node
The API that all existential type trees support
An extractor class to create and pattern match with syntax ExistentialTypeTree(tpt, whereClauses)
.
Expr wraps an abstract syntax tree and tags it with its type.
A mirror that reflects a field.
A map to implement the filter
method.
A map to implement the filter
method.
A map to implement the filter
method.
A map to implement the filter
method.
A marker trait representing an as-yet unevaluated type which doesn't assign flags to the underlying symbol.
A marker trait representing an as-yet unevaluated type which doesn't assign flags to the underlying symbol.
A marker trait representing an as-yet unevaluated type which assigns flags to the underlying symbol.
A marker trait representing an as-yet unevaluated type which assigns flags to the underlying symbol.
The API of FlagSet
instances.
All possible values that can constitute flag sets.
The type of free terms introduced by reification.
The type of free terms introduced by reification.
The API of free term symbols.
The type of free types introduced by reification.
The type of free types introduced by reification.
The API of free type symbols.
Anonymous function, eliminated by compiler phase lambdalift
Anonymous function, eliminated by compiler phase lambdalift
The API that all functions support
An extractor class to create and pattern match with syntax Function(vparams, body)
.
Common base class for Apply and TypeApply.
Common base class for Apply and TypeApply.
The API that all applies support
Precondition: params.
Precondition: params.nonEmpty. (args.nonEmpty enforced structurally.)
A reference to identifier name
.
A reference to identifier name
.
The API that all idents support
The extended API of idents that's supported in macro context universes
An extractor class to create and pattern match with syntax Ident(qual, name)
.
Conditional expression
Conditional expression
The API that all ifs support
An extractor class to create and pattern match with syntax If(cond, thenp, elsep)
.
A common base class for class and object definitions.
A common base class for class and object definitions.
The API that all impl defs support
Import clause
Import clause
The API that all imports support
An extractor class to create and pattern match with syntax Import(expr, selectors)
.
Import selector
Import selector
Representation of an imported name its optional rename and their optional positions
Eliminated by typecheck.
The API that all import selectors support
An extractor class to create and pattern match with syntax ImportSelector(name:, namePos, rename, renamePos)
.
The API of importers.
A mirror that reflects a runtime value.
Note: This map is needed even for non-dependent method types, despite what the name might imply.
Note: This map is needed even for non-dependent method types, despite what the name might imply.
The API of a mirror for a reflective universe
The API of a mirror for a reflective universe
This should be the first trait in the linearization.
This should be the first trait in the linearization.
A labelled expression.
A labelled expression. Not expressible in language syntax, but generated by the compiler to simulate while/do-while loops, and also by the pattern matcher.
The label acts much like a nested function, where params
represents
the incoming parameters. The symbol given to the LabelDef should have
a MethodType, as if it were a nested function.
Jumps are apply nodes attributed with a label's symbol. The arguments from the apply node will be passed to the label and assigned to the Idents.
Forward jumps within a block are allowed.
The API that all label defs support
An extractor class to create and pattern match with syntax LabelDef(name, params, rhs)
.
Symbol annotations parsed in Namer
(typeCompleter of
definitions) have to be lazy (#1782)
Symbol annotations parsed in Namer
(typeCompleter of
definitions) have to be lazy (#1782)
The type completer for packages.
The type completer for packages.
A class representing an as-yet unevaluated type.
A class representing an as-yet unevaluated type.
Literal
Literal
Represents a compile-time Constant (Boolean
, Byte
, Short
,
Char
, Int
, Long
, Float
, Double
, String
, java.lang.Class
or
an instance of a Java enumeration value).
Represents a compile-time Constant (Boolean
, Byte
, Short
,
Char
, Int
, Long
, Float
, Double
, String
, java.lang.Class
or
an instance of a Java enumeration value).
The API that all literals support
The API of LiteralArgument
instances.
An extractor class to create and pattern match with syntax LiteralArgument(value)
where value
is the constant argument.
An extractor class to create and pattern match with syntax Literal(value)
.
Is added by the macro engine to the results of macro expansions.
Is added by the macro engine to the results of macro expansions.
Stores the original expandee as it entered the macroExpand
function.
A throwable signalling a malformed type
A throwable signalling a malformed type
- Pattern matching expression (before compiler phase explicitouter before 2.
- Pattern matching expression (before compiler phase explicitouter before 2.10 / patmat from 2.10)
After compiler phase explicitouter before 2.10 / patmat from 2.10, cases will satisfy the following constraints:
EmptyTree
,Literal(Constant(x:Int))
or Alternative(lit|...|lit)
Ident(nme.WILDCARD)
The API that all matches support
An extractor class to create and pattern match with syntax Match(selector, cases)
.
Common base class for all member definitions: types, classes, objects, packages, vals and vars, defs.
Common base class for all member definitions: types, classes, objects, packages, vals and vars, defs.
The API that all member defs support
The API that all member scopes support
A mirror that reflects a method.
A class for method symbols
A class for method symbols
The API of method symbols.
A class representing a method type with parameters.
A class representing a method type with parameters. Note that a parameterless method is represented by a NullaryMethodType:
def m(): Int MethodType(Nil, Int) def m: Int NullaryMethodType(Int)
The API that all method types support.
An extractor class to create and pattern match with syntax MethodType(params, respte)
Here, params
is a potentially empty list of parameter symbols of the method,
and restpe
is the result type of the method.
In runtime reflection universes, mirrors are JavaMirrors
.
In runtime reflection universes, mirrors are JavaMirrors
.
The API that all Modifiers support
An extractor class to create and pattern match with syntax Modifiers(flags, privateWithin, annotations)
.
A class for module class symbols Note: Not all module classes are of this type; when unpickled, we get plain class symbols!
A class for module class symbols Note: Not all module classes are of this type; when unpickled, we get plain class symbols!
An object definition, e.
An object definition, e.g. object Foo
. Internally, objects are
quite frequently called modules to reduce ambiguity.
Eliminated by compiler phase refcheck.
The API that all module defs support
An extractor class to create and pattern match with syntax ModuleDef(mods, name, impl)
.
A mirror that reflects a Scala object definition or the static parts of a runtime class.
A class for module symbols
A class for module symbols
The API of module symbols.
The name class.
The name class. TODO - resolve schizophrenia regarding whether to treat Names as Strings or Strings as Names. Give names the key functions the absence of which make people want Strings all the time.
The API of Name instances.
A tree with a name - effectively, a DefTree or RefTree.
A tree with a name - effectively, a DefTree or RefTree.
The API that all name trees support
A class representing types with a name.
A class representing types with a name. When an application uses named arguments, the named argument types for calling isApplicable are represented as NamedType.
Defines standard names, common for term and type names: These can be accessed via the nme and tpnme members.
Represents a nested classfile annotation
Represents a nested classfile annotation
API of NestedArgument
instances.
An extractor class to create and pattern match with syntax NestedArgument(annotation)
where annotation
is the nested annotation.
Object instantiation
Object instantiation
The API that all news support
An extractor class to create and pattern match with syntax New(tpt)
.
An object representing a missing symbol
An object representing a missing symbol
The NullaryMethodType
type signature is used for parameterless methods
with declarations of the form def foo: T
The NullaryMethodType
type signature is used for parameterless methods
with declarations of the form def foo: T
The API that all nullary method types support.
An extractor class to create and pattern match with syntax NullaryMethodType(resultType)
.
A class containing the alternatives and type prefix of an overloaded symbol.
A class containing the alternatives and type prefix of an overloaded symbol.
Not used after phase typer
.
A packaging, such as package pid { stats }
A packaging, such as package pid { stats }
The API that all package defs support
An extractor class to create and pattern match with syntax PackageDef(pid, stats)
.
A period is an ordinal number for a phase in a run.
A period is an ordinal number for a phase in a run. Phases in later runs have higher periods than phases in earlier runs. Later phases have higher periods than earlier phases in the same run.
A type function or the type of a polymorphic value (and thus of kind *).
A type function or the type of a polymorphic value (and thus of kind *).
Before the introduction of NullaryMethodType, a polymorphic nullary method (e.g, def isInstanceOf[T]: Boolean) used to be typed as PolyType(tps, restpe), and a monomorphic one as PolyType(Nil, restpe) This is now: PolyType(tps, NullaryMethodType(restpe)) and NullaryMethodType(restpe) by symmetry to MethodTypes: PolyType(tps, MethodType(params, restpe)) and MethodType(params, restpe)
Thus, a PolyType(tps, TypeRef(...)) unambiguously indicates a type function (which results from eta-expanding a type constructor alias). Similarly, PolyType(tps, ClassInfoType(...)) is a type constructor.
A polytype is of kind * iff its resultType is a (nullary) method type.
The API that all polymorphic types support.
An extractor class to create and pattern match with syntax PolyType(typeParams, resultType)
.
Defines a universe-specific notion of positions.
Defines a universe-specific notion of positions. The main documentation entry about positions is located at scala.reflect.api.Position.
An exception for cyclic references from which we can recover
An exception for cyclic references from which we can recover
A tree which references a symbol-carrying entity.
A tree which references a symbol-carrying entity. References one, as opposed to defining one; definitions are in DefTrees.
The API that all ref trees support
Marks underlying reference to id as boxed.
Marks underlying reference to id as boxed.
Precondition:<\b> id must refer to a captured variable A reference such marked will refer to the boxed entity, no dereferencing with `.elem` is done on it. This tree node can be emitted by macros such as reify that call referenceCapturedVariable. It is eliminated in LambdaLift, where the boxing conversion takes place.
The API that all references support
An extractor class to create and pattern match with syntax ReferenceToBoxed(ident)
.
A class representing intersection types with refinements of the form
<parents_0> with ... with <parents_n> { decls }
Cannot be created directly;
one should always use refinedType
for creation.
A class representing intersection types with refinements of the form
<parents_0> with ... with <parents_n> { decls }
Cannot be created directly;
one should always use refinedType
for creation.
The API that all refined types support.
An extractor class to create and pattern match with syntax RefinedType(parents, decls)
Here, parents
is the list of parent types of the class, and decls
is the scope
containing all declarations in the class.
A mirror that reflects instances and static classes.
Return expression
Return expression
The API that all returns support
An extractor class to create and pattern match with syntax Return(expr)
.
A proxy for a type (identified by field underlying
) that forwards most
operations to it.
A proxy for a type (identified by field underlying
) that forwards most
operations to it. Every operation that is overridden for some kind of types is
forwarded here. Some operations are rewrapped again.
The type of compilation runs.
Compilation run uniquely identifies current invocation of the compiler (e.
An ordinal number for compiler runs.
An ordinal number for compiler runs. First run has number 1.
In runtime reflection universes, runtime representation of a class is java.lang.Class
.
In runtime reflection universes, runtime representation of a class is java.lang.Class
.
The API of a mirror for a reflective universe.
A specific annotation argument that encodes an array of bytes as an
array of Long
.
A specific annotation argument that encodes an array of bytes as an
array of Long
. The type of the argument declared in the annotation
must be String
. This specialised class is used to encode Scala
signatures for reasons of efficiency, both in term of class-file size
and in term of compiler performance.
Note: constructor is protected to force everyone to use the factory methods newScope or newNestedScope instead.
Note: constructor is protected to force everyone to use the factory methods newScope or newNestedScope instead. This is necessary because when run from reflection every scope needs to have a SynchronizedScope as mixin.
The API that all scopes support
A member selection <qualifier> .
A member selection <qualifier> . <name>
The API that all selects support
An extractor class to create and pattern match with syntax Select(qual, name)
.
Type selection <qualifier> # <name>, eliminated by RefCheck
Type selection <qualifier> # <name>, eliminated by RefCheck
The API that all selects from type trees support
An extractor class to create and pattern match with syntax SelectFromTypeTree(qualifier, name)
.
A proxy for a type (identified by field underlying
) that forwards most
operations to it (for exceptions, see WrappingProxy, which forwards even more operations).
A proxy for a type (identified by field underlying
) that forwards most
operations to it (for exceptions, see WrappingProxy, which forwards even more operations).
every operation that is overridden for some kind of types should be forwarded.
A class for singleton types of the form <prefix>.<sym.name>.type
.
A class for singleton types of the form <prefix>.<sym.name>.type
.
Cannot be created directly; one should always use singleType
for creation.
The API that all single types support.
An extractor class to create and pattern match with syntax SingleType(pre, sym)
Here, pre
is the prefix of the single-type, and sym
is the stable value symbol
referred to by the single-type.
A base class for types that represent a single value (single-types and this-types).
A base class for types that represent a single value (single-types and this-types).
Singleton type, eliminated by RefCheck
Singleton type, eliminated by RefCheck
The API that all singleton type trees support
An extractor class to create and pattern match with syntax SingletonTypeTree(ref)
.
Defines standard types.
Repetition of pattern.
Repetition of pattern.
Eliminated by compiler phases patmat (in the new pattern matcher of 2.10) or explicitouter (in the old pre-2.10 pattern matcher).
The API that all stars support
An extractor class to create and pattern match with syntax Star(elem)
.
A base class for types that defer some operations to their immediate supertype.
A base class for types that defer some operations to their immediate supertype.
A base class to compute all substitutions
A base class to compute all substitutions
A map to implement the substSym
method.
A map to implement the substSym
method.
A map to implement the substThis
method.
A map to implement the substThis
method.
A map to implement the subst
method.
A map to implement the subst
method.
Super reference, where qual
is the corresponding this
reference.
Super reference, where qual
is the corresponding this
reference.
A super reference C.super[M]
is represented as Super(This(C), M)
.
The API that all supers support
An extractor class to create and pattern match with syntax Super(qual, mix)
.
The SuperType
type is not directly written, but arises when C.super
is used
as a prefix in a TypeRef
or SingleType
.
The SuperType
type is not directly written, but arises when C.super
is used
as a prefix in a TypeRef
or SingleType
. It's internal presentation is
SuperType(thistpe, supertpe)
Here, thistpe
is the type of the corresponding this-type. For instance,
in the type arising from C.super, the thistpe
part would be ThisType(C)
.
supertpe
is the type of the super class referred to by the super
.
The API that all super types support.
An extractor class to create and pattern match with syntax SingleType(thistpe, supertpe)
A tree with a mutable symbol field, initialized to NoSymbol.
A tree with a mutable symbol field, initialized to NoSymbol.
The API that all sym trees support
The extended API of sym trees that's supported in macro context universes
The class for all symbols
The class for all symbols
The API of symbols.
The extended API of symbols that's supported in macro context universes
Instantiation template of a class or trait
Instantiation template of a class or trait
The API that all templates support
An extractor class to create and pattern match with syntax Template(parents, self, body)
.
A mirror that reflects the instance or static parts of a runtime class.
The abstract type of names representing types.
The abstract type of names representing types.
Defines standard term names that can be accessed via the nme member.
A class for term symbols
A class for term symbols
The API of term symbols.
A tree for a term.
A tree for a term. Not all trees representing terms are TermTrees; use isTerm to reliably identify terms.
The API that all term trees support
Self reference
Self reference
The API that all thises support
An extractor class to create and pattern match with syntax This(qual)
.
Substitute clazz.
Substitute clazz.this with to
. to
must be an attributed tree.
A class for this-types of the form <sym>.
A class for this-types of the form <sym>.this.type
The API that all this types support.
An extractor class to create and pattern match with syntax ThisType(sym)
where sym
is the class prefix of the this type.
Throw expression
Throw expression
The API that all tries support
An extractor class to create and pattern match with syntax Throw(expr)
.
The standard completer for top-level classes
The standard completer for top-level classes
A class that implement a default tree transformation strategy: breadth-first component-wise cloning.
A class that implement a default tree traversal strategy: breadth-first component-wise.
The type of Scala abstract syntax trees.
The type of Scala abstract syntax trees.
The API that all trees support.
The extended API of trees that's supported in macro context universes
The type of standard (lazy) tree copiers.
The API of a tree copier.
Substitute symbols in from
with symbols in to
.
Substitute symbols in from
with symbols in to
. Returns a new
tree using the new symbols and whose Ident and Select nodes are
name-consistent with the new symbols.
Note: This is currently a destructive operation on the original Tree.
Trees currently assigned a symbol in from
will be assigned the new symbols
without copying, and trees that define symbols with an info
that refer
a symbol in from
will have a new type assigned.
Try catch node
Try catch node
The API that all tries support
An extractor class to create and pattern match with syntax Try(block, catches, finalizer)
.
A tree for a type.
A tree for a type. Not all trees representing types are TypTrees; use isType to reliably identify types.
The API that all typ trees support
The base class for all types
The base class for all types
The API of types.
Explicit type application.
Explicit type application.
The API that all type applies support
An extractor class to create and pattern match with syntax TypeApply(fun, args)
.
A class for the bounds of abstract types and type parameters
A class for the bounds of abstract types and type parameters
The API that all type bounds support.
An extractor class to create and pattern match with syntax TypeBound(lower, upper)
Here, lower
is the lower bound of the TypeBounds
pair, and upper
is
the upper bound.
Type bounds tree node
Type bounds tree node
The API that all type bound trees support
An extractor class to create and pattern match with syntax TypeBoundsTree(lo, hi)
.
A class expressing upper and lower bounds constraints of type variables, as well as their instantiations.
A class expressing upper and lower bounds constraints of type variables, as well as their instantiations.
An abstract type, a type parameter, or a type alias.
An abstract type, a type parameter, or a type alias. Eliminated by erasure.
The API that all type defs support
An extractor class to create and pattern match with syntax TypeDef(mods, name, tparams, rhs)
.
A throwable signalling a type error
A throwable signalling a type error
A prototype for mapping a function over all possible types
A prototype for mapping a function over all possible types
The abstract type of names representing terms.
The abstract type of names representing terms.
Defines standard type names that can be accessed via the tpnme member.
A class for named types of the form
<prefix>.<sym.name>[args]
Cannot be created directly; one should always use typeRef
for creation.
A class for named types of the form
<prefix>.<sym.name>[args]
Cannot be created directly; one should always use typeRef
for creation. (@M: Otherwise hashing breaks)
The API that all type refs support.
An extractor class to create and pattern match with syntax TypeRef(pre, sym, args)
Here, pre
is the prefix of the type reference, sym
is the symbol
referred to by the type reference, and args
is a possible empty list of
type argumenrts.
A class for type parameters viewed from inside their scopes
A class for type parameters viewed from inside their scopes
A class of type symbols.
A class of type symbols. Alias and abstract types are direct instances of this class. Classes are instances of a subclass.
The API of type symbols.
A TypeTag
is a scala.reflect.api.TypeTags#WeakTypeTag with the additional
static guarantee that all type references are concrete, i.
A synthetic tree holding an arbitrary type.
A synthetic tree holding an arbitrary type. Not to be confused with
with TypTree, the trait for trees that are only used for type trees.
TypeTree's are inserted in several places, but most notably in
RefCheck
, where the arbitrary type trees are all replaced by
TypeTree's.
The API that all type trees support
The extended API of sym trees that's supported in macro context universes
An extractor class to create and pattern match with syntax TypeTree()
.
A class representing a type variable: not used after phase typer
.
A class representing a type variable: not used after phase typer
.
A higher-kinded TypeVar has params (Symbols) and typeArgs (Types). A TypeVar with nonEmpty typeArgs can only be instantiated by a higher-kinded type that can be applied to those args. A TypeVar is much like a TypeRef, except it has special logic for equality and subtyping.
Precondition for this class, enforced structurally: args.isEmpty && params.isEmpty.
Type annotation, eliminated by compiler phase cleanup
Type annotation, eliminated by compiler phase cleanup
The API that all typeds support
An extractor class to create and pattern match with syntax Typed(expr, tpt)
.
Used to represent unapply
methods in pattern matching.
Used to represent unapply
methods in pattern matching.
For example:
2 match { case Foo(x) => x }
Is represented as:
Match( Literal(Constant(2)), List( CaseDef( UnApply( // a dummy node that carries the type of unapplication to patmat // thehere doesn't have an underlying symbol // it only has a type assigned, therefore after `resetAllAttrs` this tree is no longer typeable Apply(Select(Ident(Foo), newTermName("unapply")), List(Ident(newTermName("" )))), // arguments of the unapply => nothing synthetic here List(Bind(newTermName("x"), Ident(nme.WILDCARD)))), EmptyTree, Ident(newTermName("x")))))
Introduced by typer. Eliminated by compiler phases patmat (in the new pattern matcher of 2.10) or explicitouter (in the old pre-2.10 pattern matcher).
The API that all unapplies support
An extractor class to create and pattern match with syntax UnApply(fun, args)
.
A type that can be passed to unique(.
A type that can be passed to unique(..) and be stored in the uniques map.
Broadly speaking, a value definition.
Broadly speaking, a value definition. All these are encoded as ValDefs:
The API that all val defs support
An extractor class to create and pattern match with syntax ValDef(mods, name, tpt, rhs)
.
A common base class for ValDefs and DefDefs.
A common base class for ValDefs and DefDefs.
The API that all val defs and def defs support
If an implicit value of type WeakTypeTag[T]
is required, the compiler will create one,
and the reflective representation of T
can be accessed via the tpe
field.
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.
The constructor/extractor for Alternative
instances.
The constructor/extractor for Alternative
instances.
A tag that preserves the identity of the Alternative
abstract type from erasure.
A tag that preserves the identity of the Alternative
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
The constructor/extractor for Annotated
instances.
The constructor/extractor for Annotated
instances.
A tag that preserves the identity of the Annotated
abstract type from erasure.
A tag that preserves the identity of the Annotated
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
The constructor/extractor for AnnotatedType
instances.
The constructor/extractor for AnnotatedType
instances.
A tag that preserves the identity of the AnnotatedType
abstract type from erasure.
A tag that preserves the identity of the AnnotatedType
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
The constructor/extractor for Annotation
instances.
The constructor/extractor for Annotation
instances.
A tag that preserves the identity of the Annotation
abstract type from erasure.
A tag that preserves the identity of the Annotation
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
The constructor/extractor for AppliedTypeTree
instances.
The constructor/extractor for AppliedTypeTree
instances.
A tag that preserves the identity of the AppliedTypeTree
abstract type from erasure.
A tag that preserves the identity of the AppliedTypeTree
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
A factory method for Apply
nodes.
A factory method for Apply
nodes.
The constructor/extractor for Apply
instances.
The constructor/extractor for Apply
instances.
0-1 argument list new, based on a type tree.
0-1 argument list new, based on a type tree.
A tag that preserves the identity of the Apply
abstract type from erasure.
A tag that preserves the identity of the Apply
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
The constructor/extractor for ArrayArgument
instances.
The constructor/extractor for ArrayArgument
instances.
A tag that preserves the identity of the ArrayArgument
abstract type from erasure.
A tag that preserves the identity of the ArrayArgument
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
The constructor/extractor for Assign
instances.
The constructor/extractor for Assign
instances.
The constructor/extractor for AssignOrNamedArg
instances.
The constructor/extractor for AssignOrNamedArg
instances.
A tag that preserves the identity of the AssignOrNamedArg
abstract type from erasure.
A tag that preserves the identity of the AssignOrNamedArg
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
A tag that preserves the identity of the Assign
abstract type from erasure.
A tag that preserves the identity of the Assign
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
When present, indicates that the host Ident
has been created from a backquoted identifier.
When present, indicates that the host Ident
has been created from a backquoted identifier.
A factory method for Bind
nodes.
A factory method for Bind
nodes.
The constructor/extractor for Bind
instances.
The constructor/extractor for Bind
instances.
A tag that preserves the identity of the Bind
abstract type from erasure.
A tag that preserves the identity of the Bind
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
Block factory that flattens directly nested blocks.
Block factory that flattens directly nested blocks.
The constructor/extractor for Block
instances.
The constructor/extractor for Block
instances.
A tag that preserves the identity of the Block
abstract type from erasure.
A tag that preserves the identity of the Block
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
The constructor/extractor for BoundedWildcardType
instances.
The constructor/extractor for BoundedWildcardType
instances.
A tag that preserves the identity of the BoundedWildcardType
abstract type from erasure.
A tag that preserves the identity of the BoundedWildcardType
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
casedef shorthand
casedef shorthand
The constructor/extractor for CaseDef
instances.
The constructor/extractor for CaseDef
instances.
A tag that preserves the identity of the CaseDef
abstract type from erasure.
A tag that preserves the identity of the CaseDef
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
the class symbol
the implementation template
The constructor/extractor for ClassDef
instances.
The constructor/extractor for ClassDef
instances.
A tag that preserves the identity of the ClassDef
abstract type from erasure.
A tag that preserves the identity of the ClassDef
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
The constructor/extractor for ClassInfoType
instances.
The constructor/extractor for ClassInfoType
instances.
A tag that preserves the identity of the ClassInfoType
abstract type from erasure.
A tag that preserves the identity of the ClassInfoType
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
A tag that preserves the identity of the ClassSymbol
abstract type from erasure.
A tag that preserves the identity of the ClassSymbol
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
A tag that preserves the identity of the CompoundType
abstract type from erasure.
A tag that preserves the identity of the CompoundType
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
The constructor/extractor for CompoundTypeTree
instances.
The constructor/extractor for CompoundTypeTree
instances.
A tag that preserves the identity of the CompoundTypeTree
abstract type from erasure.
A tag that preserves the identity of the CompoundTypeTree
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
A writer that writes to the current Console and is sensitive to replacement of the Console's output stream.
A writer that writes to the current Console and is sensitive to replacement of the Console's output stream.
The constructor/extractor for Constant
instances.
The constructor/extractor for Constant
instances.
A tag that preserves the identity of the Constant
abstract type from erasure.
A tag that preserves the identity of the Constant
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
The constructor/extractor for ConstantType
instances.
The constructor/extractor for ConstantType
instances.
A tag that preserves the identity of the ConstantType
abstract type from erasure.
A tag that preserves the identity of the ConstantType
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
A factory method for ValDef
nodes.
A factory method for ValDef
nodes.
A factory method for ValDef
nodes.
A factory method for ValDef
nodes.
A DefDef with original trees attached to the TypeTree of each parameter
A DefDef with original trees attached to the TypeTree of each parameter
A factory method for ValDef
nodes.
A factory method for ValDef
nodes.
A factory method for ValDef
nodes.
A factory method for ValDef
nodes.
A factory method for ValDef
nodes.
A factory method for ValDef
nodes.
The constructor/extractor for DefDef
instances.
The constructor/extractor for DefDef
instances.
A tag that preserves the identity of the DefDef
abstract type from erasure.
A tag that preserves the identity of the DefDef
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
A tag that preserves the identity of the DefTree
abstract type from erasure.
A tag that preserves the identity of the DefTree
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
The empty scope (immutable).
The empty scope (immutable).
The empty tree
The empty tree
A map to implement the contains
method.
A map to implement the contains
method.
An object representing an erroneous type
An object representing an erroneous type
The constructor/extractor for ExistentialType
instances.
The constructor/extractor for ExistentialType
instances.
A tag that preserves the identity of the ExistentialType
abstract type from erasure.
A tag that preserves the identity of the ExistentialType
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
The constructor/extractor for ExistentialTypeTree
instances.
The constructor/extractor for ExistentialTypeTree
instances.
A tag that preserves the identity of the ExistentialTypeTree
abstract type from erasure.
A tag that preserves the identity of the ExistentialTypeTree
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
Constructor/Extractor for Expr.
A module that contains all possible values that can constitute flag sets.
A module that contains all possible values that can constitute flag sets.
A tag that preserves the identity of the FlagSet
abstract type from erasure.
A tag that preserves the identity of the FlagSet
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
A tag that preserves the identity of the FreeTermSymbol
abstract type from erasure.
A tag that preserves the identity of the FreeTermSymbol
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
A tag that preserves the identity of the FreeTypeSymbol
abstract type from erasure.
A tag that preserves the identity of the FreeTypeSymbol
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
The constructor/extractor for Function
instances.
The constructor/extractor for Function
instances.
A tag that preserves the identity of the Function
abstract type from erasure.
A tag that preserves the identity of the Function
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
A creator and extractor for type parameterizations that strips empty type parameter lists.
A creator and extractor for type parameterizations that strips empty type parameter lists. Use this factory method to indicate the type has kind * (it's a polymorphic value) until we start tracking explicit kinds equivalent to typeFun (except that the latter requires tparams nonEmpty).
PP to AM: I've co-opted this for where I know tparams may well be empty, and
expecting to get back tpe
in such cases. Re being "forgiving" below,
can we instead say this is the canonical creator for polyTypes which
may or may not be poly? (It filched the standard "canonical creator" name.)
A tag that preserves the identity of the GenericApply
abstract type from erasure.
A tag that preserves the identity of the GenericApply
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
A factory method for Ident
nodes.
A factory method for Ident
nodes.
A factory method for Ident
nodes.
A factory method for Ident
nodes.
The constructor/extractor for Ident
instances.
The constructor/extractor for Ident
instances.
A tag that preserves the identity of the Ident
abstract type from erasure.
A tag that preserves the identity of the Ident
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
The constructor/extractor for If
instances.
The constructor/extractor for If
instances.
A tag that preserves the identity of the If
abstract type from erasure.
A tag that preserves the identity of the If
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
A tag that preserves the identity of the ImplDef
abstract type from erasure.
A tag that preserves the identity of the ImplDef
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
The constructor/extractor for Import
instances.
The constructor/extractor for Import
instances.
The constructor/extractor for ImportSelector
instances.
The constructor/extractor for ImportSelector
instances.
A tag that preserves the identity of the ImportSelector
abstract type from erasure.
A tag that preserves the identity of the ImportSelector
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
A tag that preserves the identity of the Import
abstract type from erasure.
A tag that preserves the identity of the Import
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
A tag that preserves the identity of the JavaArgument
abstract type from erasure.
A tag that preserves the identity of the JavaArgument
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
The canonical creator for implicit method types
The canonical creator for implicit method types
A factory method for LabelDef
nodes.
A factory method for LabelDef
nodes.
The constructor/extractor for LabelDef
instances.
The constructor/extractor for LabelDef
instances.
A tag that preserves the identity of the LabelDef
abstract type from erasure.
A tag that preserves the identity of the LabelDef
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
The constructor/extractor for Literal
instances.
The constructor/extractor for Literal
instances.
The constructor/extractor for LiteralArgument
instances.
The constructor/extractor for LiteralArgument
instances.
A tag that preserves the identity of the LiteralArgument
abstract type from erasure.
A tag that preserves the identity of the LiteralArgument
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
A tag that preserves the identity of the Literal
abstract type from erasure.
A tag that preserves the identity of the Literal
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
The constructor/extractor for Match
instances.
The constructor/extractor for Match
instances.
A tag that preserves the identity of the Match
abstract type from erasure.
A tag that preserves the identity of the Match
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
A tag that preserves the identity of the MemberDef
abstract type from erasure.
A tag that preserves the identity of the MemberDef
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
A tag that preserves the identity of the MemberScope
abstract type from erasure.
A tag that preserves the identity of the MemberScope
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
A tag that preserves the identity of the MethodSymbol
abstract type from erasure.
A tag that preserves the identity of the MethodSymbol
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
The constructor/extractor for MethodType
instances.
The constructor/extractor for MethodType
instances.
A tag that preserves the identity of the MethodType
abstract type from erasure.
A tag that preserves the identity of the MethodType
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
The factory for Modifiers
instances.
The factory for Modifiers
instances.
The factory for Modifiers
instances.
The factory for Modifiers
instances.
The constructor/extractor for Modifiers
instances.
The constructor/extractor for Modifiers
instances.
A tag that preserves the identity of the Modifiers
abstract type from erasure.
A tag that preserves the identity of the Modifiers
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
the class symbol
the implementation template
The constructor/extractor for ModuleDef
instances.
The constructor/extractor for ModuleDef
instances.
A tag that preserves the identity of the ModuleDef
abstract type from erasure.
A tag that preserves the identity of the ModuleDef
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
A tag that preserves the identity of the ModuleSymbol
abstract type from erasure.
A tag that preserves the identity of the ModuleSymbol
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
A tag that preserves the identity of the Name
abstract type from erasure.
A tag that preserves the identity of the Name
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
A tag that preserves the identity of the NameTree
abstract type from erasure.
A tag that preserves the identity of the NameTree
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
The constructor/extractor for NestedArgument
instances.
The constructor/extractor for NestedArgument
instances.
A tag that preserves the identity of the NestedArgument
abstract type from erasure.
A tag that preserves the identity of the NestedArgument
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
0-1 argument list new, based on a symbol.
0-1 argument list new, based on a symbol.
0-1 argument list new, based on a type.
0-1 argument list new, based on a type.
Factory method for object creation new tpt(args_1)...(args_n)
A New(t, as)
is expanded to: (new t).<init>(as)
Factory method for object creation new tpt(args_1)...(args_n)
A New(t, as)
is expanded to: (new t).<init>(as)
The constructor/extractor for New
instances.
The constructor/extractor for New
instances.
A tag that preserves the identity of the New
abstract type from erasure.
A tag that preserves the identity of the New
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
The empty set of flags
The empty set of flags
An empty Modifiers
object: no flags, empty visibility annotation and no Scala annotations.
An empty Modifiers
object: no flags, empty visibility annotation and no Scala annotations.
A special "missing" position.
A special "missing" position.
An object representing a non-existing prefix
An object representing a non-existing prefix
An object representing a non-existing type
An object representing a non-existing type
The constructor/extractor for NullaryMethodType
instances.
The constructor/extractor for NullaryMethodType
instances.
A tag that preserves the identity of the NullaryMethodType
abstract type from erasure.
A tag that preserves the identity of the NullaryMethodType
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
The constructor/extractor for PackageDef
instances.
The constructor/extractor for PackageDef
instances.
A tag that preserves the identity of the PackageDef
abstract type from erasure.
A tag that preserves the identity of the PackageDef
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
The constructor/extractor for PolyType
instances.
The constructor/extractor for PolyType
instances.
A tag that preserves the identity of the PolyType
abstract type from erasure.
A tag that preserves the identity of the PolyType
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
A tag that preserves the identity of the Position
abstract type from erasure.
A tag that preserves the identity of the Position
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
A tag that preserves the identity of the RefTree
abstract type from erasure.
A tag that preserves the identity of the RefTree
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
The constructor/extractor for ReferenceToBoxed
instances.
The constructor/extractor for ReferenceToBoxed
instances.
A tag that preserves the identity of the ReferenceToBoxed
abstract type from erasure.
A tag that preserves the identity of the ReferenceToBoxed
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
The constructor/extractor for RefinedType
instances.
The constructor/extractor for RefinedType
instances.
A tag that preserves the identity of the RefinedType
abstract type from erasure.
A tag that preserves the identity of the RefinedType
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
The constructor/extractor for Return
instances.
The constructor/extractor for Return
instances.
A tag that preserves the identity of the Return
abstract type from erasure.
A tag that preserves the identity of the Return
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
A tag that preserves the identity of the Scope
abstract type from erasure.
A tag that preserves the identity of the Scope
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
A factory method for Select
nodes.
A factory method for Select
nodes.
A factory method for Select
nodes.
The constructor/extractor for Select
instances.
The constructor/extractor for Select
instances.
The constructor/extractor for SelectFromTypeTree
instances.
The constructor/extractor for SelectFromTypeTree
instances.
A tag that preserves the identity of the SelectFromTypeTree
abstract type from erasure.
A tag that preserves the identity of the SelectFromTypeTree
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
A tag that preserves the identity of the Select
abstract type from erasure.
A tag that preserves the identity of the Select
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
The constructor/extractor for SingleType
instances.
The constructor/extractor for SingleType
instances.
A tag that preserves the identity of the SingleType
abstract type from erasure.
A tag that preserves the identity of the SingleType
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
A tag that preserves the identity of the SingletonType
abstract type from erasure.
A tag that preserves the identity of the SingletonType
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
The constructor/extractor for SingletonTypeTree
instances.
The constructor/extractor for SingletonTypeTree
instances.
A tag that preserves the identity of the SingletonTypeTree
abstract type from erasure.
A tag that preserves the identity of the SingletonTypeTree
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
The constructor/extractor for Star
instances.
The constructor/extractor for Star
instances.
A tag that preserves the identity of the Star
abstract type from erasure.
A tag that preserves the identity of the Star
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
Adds the sm
String interpolator to a scala.StringContext.
Adds the sm
String interpolator to a scala.StringContext.
A factory method for Super
nodes.
A factory method for Super
nodes.
The constructor/extractor for Super
instances.
The constructor/extractor for Super
instances.
A tag that preserves the identity of the Super
abstract type from erasure.
A tag that preserves the identity of the Super
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
The constructor/extractor for SuperType
instances.
The constructor/extractor for SuperType
instances.
A tag that preserves the identity of the SuperType
abstract type from erasure.
A tag that preserves the identity of the SuperType
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
When present, suppresses macro expansion for the host.
When present, suppresses macro expansion for the host. This is occasionally necessary, e.g. to prohibit eta-expansion of macros.
Does not affect expandability of child nodes, there's context.withMacrosDisabled for that (but think thrice before using that API - see the discussion at https://github.com/scala/scala/pull/1639).
A tag that preserves the identity of the SymTree
abstract type from erasure.
A tag that preserves the identity of the SymTree
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
A tag that preserves the identity of the Symbol
abstract type from erasure.
A tag that preserves the identity of the Symbol
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
The constructor/extractor for Template
instances.
The constructor/extractor for Template
instances.
A tag that preserves the identity of the Template
abstract type from erasure.
A tag that preserves the identity of the Template
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
A tag that preserves the identity of the TermName
abstract type from erasure.
A tag that preserves the identity of the TermName
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
A tag that preserves the identity of the TermSymbol
abstract type from erasure.
A tag that preserves the identity of the TermSymbol
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
A tag that preserves the identity of the TermTree
abstract type from erasure.
A tag that preserves the identity of the TermTree
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
A factory method for This
nodes.
A factory method for This
nodes.
The constructor/extractor for This
instances.
The constructor/extractor for This
instances.
A tag that preserves the identity of the This
abstract type from erasure.
A tag that preserves the identity of the This
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
The constructor/extractor for ThisType
instances.
The constructor/extractor for ThisType
instances.
A tag that preserves the identity of the ThisType
abstract type from erasure.
A tag that preserves the identity of the ThisType
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
A factory method for Throw
nodes.
A factory method for Throw
nodes.
The constructor/extractor for Throw
instances.
The constructor/extractor for Throw
instances.
A tag that preserves the identity of the Throw
abstract type from erasure.
A tag that preserves the identity of the Throw
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
Extracts symbol of thrown exception from AnnotationInfo.
Extracts symbol of thrown exception from AnnotationInfo.
Supports both “old-style” @throws(classOf[Exception])
as well as “new-stye” @throws[Exception]("cause")
annotations.
A tag that preserves the identity of the Tree
abstract type from erasure.
A tag that preserves the identity of the Tree
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
A factory method for Try
nodes.
A factory method for Try
nodes.
The constructor/extractor for Try
instances.
The constructor/extractor for Try
instances.
A tag that preserves the identity of the Try
abstract type from erasure.
A tag that preserves the identity of the Try
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
A tag that preserves the identity of the TypTree
abstract type from erasure.
A tag that preserves the identity of the TypTree
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
The constructor/extractor for TypeApply
instances.
The constructor/extractor for TypeApply
instances.
A tag that preserves the identity of the TypeApply
abstract type from erasure.
A tag that preserves the identity of the TypeApply
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
The constructor/extractor for TypeBounds
instances.
The constructor/extractor for TypeBounds
instances.
A tag that preserves the identity of the TypeBounds
abstract type from erasure.
A tag that preserves the identity of the TypeBounds
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
The constructor/extractor for TypeBoundsTree
instances.
The constructor/extractor for TypeBoundsTree
instances.
A tag that preserves the identity of the TypeBoundsTree
abstract type from erasure.
A tag that preserves the identity of the TypeBoundsTree
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
A TypeDef node which defines abstract type or type parameter for given sym
A TypeDef node which defines abstract type or type parameter for given sym
A TypeDef node which defines given sym
with given tight hand side rhs
.
A TypeDef node which defines given sym
with given tight hand side rhs
.
The constructor/extractor for TypeDef
instances.
The constructor/extractor for TypeDef
instances.
A tag that preserves the identity of the TypeDef
abstract type from erasure.
A tag that preserves the identity of the TypeDef
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
A tag that preserves the identity of the TypeName
abstract type from erasure.
A tag that preserves the identity of the TypeName
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
The constructor/extractor for TypeRef
instances.
The constructor/extractor for TypeRef
instances.
A tag that preserves the identity of the TypeRef
abstract type from erasure.
A tag that preserves the identity of the TypeRef
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
A tag that preserves the identity of the TypeSymbol
abstract type from erasure.
A tag that preserves the identity of the TypeSymbol
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
Type tags corresponding to primitive types and constructor/extractor for WeakTypeTags.
A tag that preserves the identity of the Type
abstract type from erasure.
A tag that preserves the identity of the Type
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
A factory method for TypeTree
nodes.
A factory method for TypeTree
nodes.
The constructor/extractor for TypeTree
instances.
The constructor/extractor for TypeTree
instances.
A tag that preserves the identity of the TypeTree
abstract type from erasure.
A tag that preserves the identity of the TypeTree
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
The constructor/extractor for Typed
instances.
The constructor/extractor for Typed
instances.
A tag that preserves the identity of the Typed
abstract type from erasure.
A tag that preserves the identity of the Typed
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
The constructor/extractor for UnApply
instances.
The constructor/extractor for UnApply
instances.
A tag that preserves the identity of the UnApply
abstract type from erasure.
A tag that preserves the identity of the UnApply
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
A factory method for ValDef
nodes.
A factory method for ValDef
nodes.
A factory method for ValDef
nodes.
A factory method for ValDef
nodes.
The constructor/extractor for ValDef
instances.
The constructor/extractor for ValDef
instances.
A tag that preserves the identity of the ValDef
abstract type from erasure.
A tag that preserves the identity of the ValDef
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
A tag that preserves the identity of the ValOrDefDef
abstract type from erasure.
A tag that preserves the identity of the ValOrDefDef
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
Type tags corresponding to primitive types and constructor/extractor for WeakTypeTags.
An object representing an unknown type, used during type inference.
An object representing an unknown type, used during type inference. If you see WildcardType outside of inference it is almost certainly a bug.
Type with all top-level occurrences of abstract types replaced by their bounds
Type with all top-level occurrences of abstract types replaced by their bounds
AnnotationChecker.adaptBoundsToAnnotations
Register an annotation checker.
Register an annotation checker. Typically these are added by compiler plugins.
The API of FlagSet
instances.
The API of FlagSet
instances.
Make symbol sym
a member of scope tp.decls
where thistp
is the narrowed owner type of the scope.
Make symbol sym
a member of scope tp.decls
where thistp
is the narrowed owner type of the scope.
Creator for AnnotatedTypes.
Creator for AnnotatedTypes. It returns the underlying type if annotations.isEmpty rather than walking into the assertion.
AnnotationChecker.annotationsConform
AnnotationChecker.annotationsGlb
AnnotationChecker.annotationsLub
Very convenient.
Very convenient.
A creator for type applications
A creator for type applications
A creator for existential types where the type arguments, rather than being applied directly, are interpreted as the upper bounds of unknown types.
A creator for existential types where the type arguments, rather than being applied directly, are interpreted as the upper bounds of unknown types. For instance if the type argument list given is List(AnyRefClass), the resulting type would be e.g. Set[_ <: AnyRef] rather than Set[AnyRef] .
Convert array parameters denoting a repeated parameter of a Java method
to JavaRepeatedParamClass
types.
Convert array parameters denoting a repeated parameter of a Java method
to JavaRepeatedParamClass
types.
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
.
Check that the executing thread is the compiler thread.
Check that the executing thread is the compiler thread. No-op here, overridden in interactive.Global.
Perform given operation at given phase.
Perform given operation at given phase.
Assigns a given position to all position-less nodes of a given AST.
Assigns a given position to all position-less nodes of a given AST.
Turns a path into a String, introducing backquotes as necessary.
Turns a path into a String, introducing backquotes as necessary.
Create a base type sequence consisting of a single type
Create a base type sequence consisting of a single type
Since when it is to be "at" a phase is inherently ambiguous, a couple unambiguously named methods.
Since when it is to be "at" a phase is inherently ambiguous, a couple unambiguously named methods.
Does this type have a prefix that begins with a type variable,
or is it a refinement type? For type prefixes that fulfil this condition,
type selections with the same name of equal (as determined by =:=
) prefixes are
considered equal in regard to =:=
.
Does this type have a prefix that begins with a type variable,
or is it a refinement type? For type prefixes that fulfil this condition,
type selections with the same name of equal (as determined by =:=
) prefixes are
considered equal in regard to =:=
.
Java binary names, like scala/runtime/Nothing$.
Java binary names, like scala/runtime/Nothing$.
Mark a variable as captured; i.
Mark a variable as captured; i.e. force boxing in a *Ref type.
Convert type of a captured variable to *Ref type.
Convert type of a captured variable to *Ref type.
Convert type of a captured variable to *Ref type.
Convert type of a captured variable to *Ref type.
Check well-kindedness of type application (assumes arities are already checked) -- @M
Check well-kindedness of type application (assumes arities are already checked) -- @M
This check is also performed when abstract type members become concrete (aka a "type alias") -- then tparams.length==1 (checked one type member at a time -- in that case, prefix is the name of the type alias)
Type application is just like value application: it's "contravariant" in the sense that the type parameters of the supplied type arguments must conform to the type parameters of the required type parameters:
e.g. class Iterable[t, m[+x <: t]] --> the application Iterable[Int, List] is okay, since List's type parameter is also covariant and its bounds are weaker than <: Int
Memory to store all names sequentially.
Memory to store all names sequentially.
Create a copy of the receiver object.
Convenience functions which derive symbols by cloning.
Convenience functions which derive symbols by cloning.
Clone symbols and apply the given function to each new symbol's info.
Clone symbols and apply the given function to each new symbol's info.
the prototypical symbols
the function to apply to the infos
the newly created, info-adjusted symbols
Return closest enclosing method, unless shadowed by an enclosing class.
Return closest enclosing method, unless shadowed by an enclosing class.
Create the base type sequence of a compound type wuth given tp.
Create the base type sequence of a compound type wuth given tp.parents
Create a new MethodType of the same class as tp, i.
Create a new MethodType of the same class as tp, i.e. keep JavaMethodType
True if all three arguments have the same number of elements and the function is true for all the triples.
True if all three arguments have the same number of elements and the function is true for all the triples.
Create a class and a companion object, enter in enclosing scope, and initialize with a lazy type completer.
Create a class and a companion object, enter in enclosing scope, and initialize with a lazy type completer.
The owner of the newly created class and object
The simple name of the newly created class
The completer to be used to set the info of the class and the module
Functions which perform the standard clone/substituting on the given symbols and type, then call the creator function with the new symbols and type as arguments.
Functions which perform the standard clone/substituting on the given symbols and type, then call the creator function with the new symbols and type as arguments.
The current period.
The current period.
The current compiler run identifier.
The current compiler run identifier.
Prints a stack trace if -Ydebug or equivalent was given, otherwise does nothing.
Prints a stack trace if -Ydebug or equivalent was given, otherwise does nothing.
Override with final implementation for inlining.
Override with final implementation for inlining.
A value containing all standard definitions in DefinitionsApi
A value containing all standard definitions in DefinitionsApi
Map a list of type parameter symbols to skolemized symbols, which can be deskolemized to the original type parameter.
Map a list of type parameter symbols to skolemized symbols, which can be deskolemized to the original type parameter. (A skolem is a representation of a bound variable when viewed inside its scope.) !!!Adriaan: this does not work for hk types.
Derives a new list of symbols from the given list by mapping the given list across the given function.
Derives a new list of symbols from the given list by mapping the given list across the given function. Then fixes the info of all the new symbols by substituting the new symbols for the original symbols.
the prototypical symbols
the function to create new symbols
the new list of info-adjusted symbols
Derives a new Type by first deriving new symbols as in deriveSymbols,
then performing the same oldSyms => newSyms substitution on tpe
as is
performed on the symbol infos in deriveSymbols.
Derives a new Type by first deriving new symbols as in deriveSymbols,
then performing the same oldSyms => newSyms substitution on tpe
as is
performed on the symbol infos in deriveSymbols.
the prototypical symbols
the function to create new symbols
the prototypical type
the new symbol-subsituted type
Derives a new Type by instantiating the given list of symbols as WildcardTypes.
Derives a new Type by instantiating the given list of symbols as WildcardTypes.
the symbols to replace
the new type with WildcardType replacing those syms
Substitutes the empty scope for any non-empty decls in the type.
Substitutes the empty scope for any non-empty decls in the type.
Turn any T* types into Seq[T] except when in method parameter position.
Turn any T* types into Seq[T] except when in method parameter position.
Remove any occurrence of type <singleton> from this type and its parents
Remove any occurrence of type <singleton> from this type and its parents
An empty deferred value definition corresponding to:
val _: _
This is used as a placeholder in the self
parameter Template if there is
no definition of a self value of self type.
An empty deferred value definition corresponding to:
val _: _
This is used as a placeholder in the self
parameter Template if there is
no definition of a self value of self type.
Ensure that given tree has no positions that overlap with
any of the positions of others
.
Ensure that given tree has no positions that overlap with
any of the positions of others
. This is done by
shortening the range, assigning TransparentPositions
to some of the nodes in tree
or focusing on the position.
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.
A creator for existential types.
A creator for existential types. This generates:
tpe1 where { tparams }
where tpe1
is the result of extrapolating tpe
with respect to tparams
.
Extrapolating means that type variables in tparams
occurring
in covariant positions are replaced by upper bounds, (minus any
SingletonClass markers), type variables in tparams
occurring in
contravariant positions are replaced by upper bounds, provided the
resulting type is legal with regard to stability, and does not contain any type
variable in tparams
.
The abstraction drops all type parameters that are not directly or
indirectly referenced by type tpe1
. If there are no remaining type
parameters, simply returns result type tpe
.
Given a set rawSyms
of term- and type-symbols, and a type
tp
, produce a set of fresh type parameters and a type so that
it can be abstracted to an existential type.
Given a set rawSyms
of term- and type-symbols, and a type
tp
, produce a set of fresh type parameters and a type so that
it can be abstracted to an existential type. Every type symbol
T
in rawSyms
is mapped to a clone. Every term symbol x
of
type T
in rawSyms
is given an associated type symbol of the
following form:
type x.type <: T with Singleton
The name of the type parameter is x.type
, to produce nice
diagnostics. The Singleton parent ensures that the type
parameter is still seen as a stable type. Type symbols in
rawSyms are fully replaced by the new symbols. Term symbols are
also replaced, except for term symbols of an Ident tree, where
only the type of the Ident is changed.
Perform operation p
on arguments tp1
, arg2
and print trace of computation.
Perform operation p
on arguments tp1
, arg2
and print trace of computation.
If option explaintypes
is set, print a subtype trace for op(found, required)
.
If option explaintypes
is set, print a subtype trace for op(found, required)
.
If option explaintypes
is set, print a subtype trace for found <:< required
.
If option explaintypes
is set, print a subtype trace for found <:< required
.
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.
From a list of types, find any which take type parameters where the type parameter bounds contain references to other any types in the list (including itself.
From a list of types, find any which take type parameters where the type parameter bounds contain references to other any types in the list (including itself.)
List of symbol pairs holding the recursive type parameter and the parameter which references it.
Are we compiling for .
Are we compiling for .NET?
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).
For fully qualified type names.
For fully qualified type names.
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 greatest lower bound of a list of types (as determined by <:<
).
The greatest lower bound of a list of types (as determined by <:<
).
The greatest lower bound of a list of types (as determined by <:<
), which have been normalized
with regard to elimSuper
.
The greatest lower bound of a list of types (as determined by <:<
), which have been normalized
with regard to elimSuper
.
Again avoiding calling length, but the lengthCompare interface is clunky.
Again avoiding calling length, but the lengthCompare interface is clunky.
The hashCode method for reference types.
The set of all installed infotransformers.
The set of all installed infotransformers.
A creator for intersection type where intersections of a single type are replaced by the type itself.
A creator for intersection type where intersections of a single type are replaced by the type itself.
A creator for intersection type where intersections of a single type are replaced by the type itself, and repeated parent classes are merged.
A creator for intersection type where intersections of a single type are replaced by the type itself, and repeated parent classes are merged.
!!! Repeated parent classes are not merged - is this a bug in the comment or in the code?
A map from lists to compound types that have the given list as parents.
A map from lists to compound types that have the given list as parents. This is used to avoid duplication in the computation of base type sequences and baseClasses. It makes use of the fact that these two operations depend only on the parents, not on the refinement.
Are we later than given phase in compilation?
Are we later than given phase in compilation?
Declares that this is a runtime reflection universe.
Declares that this is a runtime reflection universe.
This means that we can make certain assumptions to optimize the universe.
For example, we may auto-initialize symbols on flag and annotation requests
(see shouldTriggerCompleter
below for more details).
On the other hand, this also means that usage scenarios of the universe will differ from the conventional ones. For example, we have to do additional cleanup in order to prevent memory leaks: http://groups.google.com/group/scala-internals/browse_thread/thread/eabcf3d406dab8b2.
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.
Is the given name valid for a top-level class? We exclude names with embedded $-signs, because these are nested classes or anonymous classes,
Is the given name valid for a top-level class? We exclude names with embedded $-signs, because these are nested classes or anonymous classes,
SLS 3.
SLS 3.3, Non-Value Types Is the given type definitely a non-value type, as defined in SLS 3.3? The specification-enumerated non-value types are method types, polymorphic method types, and type constructors. Supplements to the specified set of non-value types include: types which wrap non-value symbols (packages abd statics), overloaded types. Varargs and by-name types T* and (=>T) are not designated non-value types because there is code which depends on using them as type arguments, but their precise status is unclear.
The isNumericValueType tests appear redundant, but without them test/continuations-neg/function3.
The isNumericValueType tests appear redundant, but without them test/continuations-neg/function3.scala goes into an infinite loop. (Even if the calls are to typeSymbolDirect.)
Is intersection of given types populated? That is, for all types tp1, tp2 in intersection for all common base classes bc of tp1 and tp2 let bt1, bt2 be the base types of tp1, tp2 relative to class bc Then: bt1 and bt2 have the same prefix, and any corresponding non-variant type arguments of bt1 and bt2 are the same
Is intersection of given types populated? That is, for all types tp1, tp2 in intersection for all common base classes bc of tp1 and tp2 let bt1, bt2 be the base types of tp1, tp2 relative to class bc Then: bt1 and bt2 have the same prefix, and any corresponding non-variant type arguments of bt1 and bt2 are the same
Might the given symbol be important when calculating the prefix of a type? When tp.
Might the given symbol be important when calculating the prefix
of a type? When tp.asSeenFrom(pre, clazz) is called on tp
,
the result will be tp
unchanged if pre
is trivial and clazz
is a symbol such that isPossiblePrefix(clazz) == false.
Is type tp a raw type?
Is type tp a raw type?
Is the tree Predef, scala.
Is the tree Predef, scala.Predef, or _root_.scala.Predef?
Do tp1
and tp2
denote equivalent types?
Do tp1
and tp2
denote equivalent types?
Are tps1
and tps2
lists of pairwise equivalent types?
Are tps1
and tps2
lists of pairwise equivalent types?
Are tps1
and tps2
lists of equal length such that all elements
of tps1
conform to corresponding elements of tps2
?
Are tps1
and tps2
lists of equal length such that all elements
of tps1
conform to corresponding elements of tps2
?
This is defined and named as it is because the goal is to exclude source level types which are not value types (e.
This is defined and named as it is because the goal is to exclude source level types which are not value types (e.g. MethodType) without excluding necessary internal types such as WildcardType. There are also non-value types which can be used as type arguments (e.g. type constructors.)
SLS 3.
SLS 3.2, Value Types Is the given type definitely a value type? A true result means it verifiably is, but a false result does not mean it is not, only that it cannot be assured. To avoid false positives, this defaults to false, but since Type is not sealed, one should take a false answer with a grain of salt. This method may be primarily useful as documentation; it is likely that !isNonValueType(tp) will serve better than isValueType(tp).
Do type arguments targs
conform to formal parameters tparams
?
Do type arguments targs
conform to formal parameters tparams
?
Delegates the transformation strategy to scala.reflect.internal.Trees
,
because pattern matching on abstract types we have here degrades performance.
Delegates the transformation strategy to scala.reflect.internal.Trees
,
because pattern matching on abstract types we have here degrades performance.
Delegates the traversal strategy to scala.reflect.internal.Trees
,
because pattern matching on abstract types we have here degrades performance.
Delegates the traversal strategy to scala.reflect.internal.Trees
,
because pattern matching on abstract types we have here degrades performance.
The least upper bound of a list of types, as determined by <:<
.
The least upper bound of a list of types, as determined by <:<
.
The maximum allowable depth of lubs or glbs over types ts
.
The maximum allowable depth of lubs or glbs over types ts
.
Convert a scala.reflect.Manifest to a scala.reflect.api.TypeTags#TypeTag.
Convert a scala.reflect.Manifest to a scala.reflect.api.TypeTags#TypeTag.
Compiler usually generates these conversions automatically, when a manifest for a type T
is in scope,
and an implicit of type TypeTag[T]
is requested, but this method can also be called manually.
For example:
manifestToTypeTag(scala.reflect.runtime.currentMirror, implicitly[Manifest[String]])
like map2, but returns list xs
itself - instead of a copy - if function
f
maps all elements to themselves.
like map2, but returns list xs
itself - instead of a copy - if function
f
maps all elements to themselves.
A deep map on a symbol's paramss.
A deep map on a symbol's paramss.
A function implementing tp1
matches tp2
.
A function implementing tp1
matches tp2
.
The maximum number of recursions allowed in toString
The maximum number of recursions allowed in toString
Compute lub (if variance == 1
) or glb (if variance == -1
) of given list
of types tps
.
Compute lub (if variance == 1
) or glb (if variance == -1
) of given list
of types tps
. All types in tps
are typerefs or singletypes
with the same symbol.
Return Some(x)
if the computation succeeds with result x
.
Return None
if the computation fails.
All these mm methods are "deep map" style methods for mapping etc.
All these mm methods are "deep map" style methods for mapping etc. on a list of lists while avoiding unnecessary intermediate structures like those created via flatten.
Returns the mirror that loaded given symbol
Returns the mirror that loaded given symbol
1.
1. If owner
is a package class (but not the empty package) and name
is a term name, make a new package
<owner>.<name>, otherwise return NoSymbol.
Exception: If owner is root and a java class with given name exists, create symbol in empty package instead
2. If owner
is the scala package and name
designates a phantom class, return
the corresponding class symbol and enter it into this mirror's ScalaPackage.
Creates an importer that moves reflection artifacts between universes.
Creates an importer that moves reflection artifacts between universes.
Equivalent to !(this eq that)
.
Equivalent to !(this eq that)
.
true
if the argument is not a reference to the receiver object; false
otherwise.
Does a pattern of type patType
need an outer test when executed against
selector type selType
in context defined by currentOwner
?
Does a pattern of type patType
need an outer test when executed against
selector type selType
in context defined by currentOwner
?
A more persistent version of Type#memberType
which does not require
that the symbol is a direct member of the prefix.
A more persistent version of Type#memberType
which does not require
that the symbol is a direct member of the prefix.
For instance:
class C[T] { sealed trait F[A] object X { object S1 extends F[T] } class S2 extends F[T] } object O extends C[Int] { def foo(f: F[Int]) = f match {...} // need to enumerate sealed subtypes of the scrutinee here. } class S3 extends O.F[String] nestedMemberType(<S1>, <O.type>, <C>) = O.X.S1.type nestedMemberType(<S2>, <O.type>, <C>) = O.S2.type nestedMemberType(<S3>, <O.type>, <C>) = S3.type
The symbol of the subtype
The prefix from which the symbol is seen
A creator for existential types which flattens nested existentials.
A creator for existential types which flattens nested existentials.
Create a new free term.
Create a new free term. Its owner is NoSymbol.
Create a new free type.
Create a new free type. Its owner is NoSymbol.
Creates a lazy tree copier.
Creates a lazy tree copier.
Create a new scope nested in another one with which it shares its elements
Create a new scope nested in another one with which it shares its elements
Hook to define what showRaw(...)
means.
Hook to define what showRaw(...)
means.
Create a new scope
Create a new scope
Create a new scope with given initial elements
Create a new scope with given initial elements
Creates a strict tree copier.
Creates a strict tree copier.
Create a term name from string.
Create a term name from string.
Create a term name from the UTF8 encoded bytes in bs[offset.
Create a term name from the UTF8 encoded bytes in bs[offset..offset+len-1].
Create a term name from the characters in cs[offset.
Create a term name from the characters in cs[offset..offset+len-1]. TODO - have a mode where name validation is performed at creation time (e.g. if a name has the string "$class" in it, then fail if that string is not at the very end.)
Create a term name from the characters in cs[offset.
Create a term name from the characters in cs[offset..offset+len-1].
Hook to define what show(...)
means.
Hook to define what show(...)
means.
Create a type name from string.
Create a type name from string.
Create a type name from the UTF8 encoded bytes in bs[offset.
Create a type name from the UTF8 encoded bytes in bs[offset..offset+len-1].
Create a type name from the characters in cs[offset.
Create a type name from the characters in cs[offset..offset+len-1].
Members of the given class, other than those inherited from Any or AnyRef.
Members of the given class, other than those inherited from Any or AnyRef.
Normalize any type aliases within this type (@see Type#normalize).
Normalize any type aliases within this type (@see Type#normalize). Note that this depends very much on the call to "normalize", not "dealias", so it is no longer carries the too-stealthy name "deAlias".
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
if there's a package
member object in pkgClass
, enter its members into it.
if there's a package
member object in pkgClass
, enter its members into it.
The original owner of a class.
The original owner of a class. Used by the backend to generate EnclosingMethod attributes.
Compute an existential type from hidden symbols hidden
and type tp
.
Compute an existential type from hidden symbols hidden
and type tp
.
The original type
The owner for Java raw types.
The phase identifier of the given period.
The phase identifier of the given period.
The phase associated with given period.
The phase associated with given period.
The phase which has given index as identifier.
The phase which has given index as identifier.
Adds backticks if the name is a scala keyword.
Adds backticks if the name is a scala keyword.
The raw to existential map converts a raw type to an existential type.
The raw to existential map converts a raw type to an existential type. It is necessary because we might have read a raw type of a parameterized Java class from a class file. At the time we read the type the corresponding class file might still not be read, so we do not know what the type parameters of the type are. Therefore the conversion of raw types to existential types might not have taken place in ClassFileparser.sigToType (where it is usually done).
Mark given identifier as a reference to a captured variable itself
suppressing dereferencing with the elem
field.
Mark given identifier as a reference to a captured variable itself
suppressing dereferencing with the elem
field.
The canonical creator for a refined type with an initially empty scope.
The canonical creator for a refined type with an initially empty scope.
...
...
...
the canonical creator for a refined type with a given scope
the canonical creator for a refined type with a given scope
Use refiy
to produce the abstract syntax tree representing a given Scala expression.
Use refiy
to produce the abstract syntax tree representing a given Scala expression.
For example:
val five = reify{ 5 } // Literal(Constant(5)) reify{ 2 + 4 } // Apply( Select( Literal(Constant(2)), newTermName("$plus")), List( Literal(Constant(4)) ) ) reify{ five.splice + 4 } // Apply( Select( Literal(Constant(5)), newTermName("$plus")), List( Literal(Constant(4)) ) )
The produced tree is path dependent on the Universe reify
was called from.
Use scala.reflect.api.Exprs#Expr.splice to embed an existing expression into a reify
call. Use Expr to turn a Tree into an expression that can be spliced.
Remove all annotation checkers
Remove all annotation checkers
Repack existential types, otherwise they sometimes get unpacked in the wrong location (type inference comes up with an unexpected skolem)
Repack existential types, otherwise they sometimes get unpacked in the wrong location (type inference comes up with an unexpected skolem)
The run identifier of the given period.
The run identifier of the given period.
Creates a runtime reflection mirror from a JVM classloader.
Creates a runtime reflection mirror from a JVM classloader.
For more information about Mirrors
s, see scala.reflect.api.Mirrors or the
Reflection Guide: Mirrors
True if two lists have the same length.
True if two lists have the same length. Since calling length on linear sequences is O(n), it is an inadvisable way to test length equality.
Unlike compiler universes, reflective universes can auto-initialize symbols on flag requests.
Unlike compiler universes, reflective universes can auto-initialize symbols on flag requests.
scalac wasn't designed with such auto-initialization in mind, and quite often it makes assumptions that flag requests won't cause initialization. Therefore enabling auto-init leads to cyclic errors. We could probably fix those, but at the moment it's too risky.
Reflective universes share codebase with scalac, but their surface is much smaller, which means less assumptions.
These assumptions are taken care of in this overriden shouldTriggerCompleter
method.
Renders a prettified representation of a flag set.
Renders a prettified representation of a flag set.
Renders a prettified representation of a name.
Renders a prettified representation of a name.
Renders a representation of a reflection artifact as desugared Java code.
Renders a representation of a reflection artifact as desugared Java code.
Renders internal structure of a flag set.
Renders internal structure of a flag set.
Renders internal structure of a name.
Renders internal structure of a name.
Renders internal structure of a reflection artifact as the visualization of a Scala syntax tree.
Renders internal structure of a reflection artifact as the visualization of a Scala syntax tree.
The canonical creator for single-types
The canonical creator for single-types
The current skolemization level, needed for the algorithms in isSameType, isSubType that do constraint solving under a prefix.
The current skolemization level, needed for the algorithms in isSameType, isSubType that do constraint solving under a prefix.
Solve constraint collected in types tvars
.
Solve constraint collected in types tvars
.
All type variables to be instantiated.
The type parameters corresponding to tvars
The variances of type parameters; need to reverse solution direction for all contravariant variables.
When true
search for max solution else min.
A minimal type list which has a given list of types as its base type sequence
A minimal type list which has a given list of types as its base type sequence
Does type tp
implement symbol sym
with same or
stronger type? Exact only if sym
is a member of some
refinement type, otherwise we might return false negatives.
Does type tp
implement symbol sym
with same or
stronger type? Exact only if sym
is a member of some
refinement type, otherwise we might return false negatives.
The period at the start of run that includes period
.
The period at the start of run that includes period
.
An implicit conversion from String to TermName.
An implicit conversion from String to TermName.
Enables an alternative notation "map": TermName
as opposed to newTermName("map")
.
An implicit conversion from String to TypeName.
An implicit conversion from String to TypeName.
Enables an alternative notation "List": TypeName
as opposed to newTypeName("List")
.
Overridden when we know more about what was happening during a failure.
Overridden when we know more about what was happening during a failure.
Make each type var in this type use its original type for comparisons instead of collecting constraints.
Make each type var in this type use its original type for comparisons instead of collecting constraints.
Creates a String representation of this object.
Creates a String representation of this object. The default representation is platform dependent. On the java platform it is the concatenation of the class name, "@", and the object's hashcode in hexadecimal.
a String representation of the object.
Dump each symbol to stdout after shutdown.
Dump each symbol to stdout after shutdown.
The standard (lazy) tree copier.
The standard (lazy) tree copier.
By default trees are printed with show
By default trees are printed with show
The maximum depth of type tp
The maximum depth of type tp
A creator for a type functions, assuming the type parameters tps already have the right owner.
A creator for a type functions, assuming the type parameters tps already have the right owner.
A creator for anonymous type functions, where the symbol for the type function still needs to be created.
A creator for anonymous type functions, where the symbol for the type function still needs to be created.
TODO: type params of anonymous type functions, which currently can only arise from normalising type aliases, are owned by the type alias of which they are the eta-expansion higher-order subtyping expects eta-expansion of type constructors that arise from a class; here, the type params are owned by that class, but is that the right thing to do?
Shortcut for implicitly[TypeTag[T]].tpe
Shortcut for implicitly[TypeTag[T]].tpe
A collector that tests for existential types appearing at given variance in a type
A collector that tests for existential types appearing at given variance in a type
The canonical creator for typerefs todo: see how we can clean this up a bit
The canonical creator for typerefs todo: see how we can clean this up a bit
Shortcut for implicitly[TypeTag[T]]
Shortcut for implicitly[TypeTag[T]]
Convert a scala.reflect.api.TypeTags#TypeTag to a scala.reflect.Manifest.
Convert a scala.reflect.api.TypeTags#TypeTag to a scala.reflect.Manifest.
Compiler usually generates these conversions automatically, when a type tag for a type T
is in scope,
and an implicit of type Manifest[T]
is requested, but this method can also be called manually.
For example:
typeTagToManifest(scala.reflect.runtime.currentMirror, implicitly[TypeTag[String]])
Delegate for a TypeTree symbol.
Delegate for a TypeTree symbol. This operation is unsafe because it may trigger type checking when forcing the type symbol of the underlying type.
A map to convert every occurrence of a type variable to a wildcard type.
A map to convert every occurrence of a type variable to a wildcard type.
A list of the typevars in a type.
A list of the typevars in a type.
A merker object for a base type sequence that's no yet computed.
A merker object for a base type sequence that's no yet computed. used to catch inheritance cycles
A log of type variable with their original constraints.
A log of type variable with their original constraints. Used in order to undo constraints in the case of isSubType/isSameType failure.
Assert that packages have package scopes
Assert that packages have package scopes
Shortcut for implicitly[WeakTypeTag[T]].tpe
Shortcut for implicitly[WeakTypeTag[T]].tpe
Shortcut for implicitly[WeakTypeTag[T]]
Shortcut for implicitly[WeakTypeTag[T]]
A map to convert every occurrence of a wildcard type to a fresh type variable
A map to convert every occurrence of a wildcard type to a fresh type variable
Execute op
while printing a trace of the operations on types executed.
Execute op
while printing a trace of the operations on types executed.
A position that wraps the non-empty set of trees.
A position that wraps the non-empty set of trees. The point of the wrapping position is the point of the first trees' position. If some of the trees are non-synthetic, returns a range position enclosing the non-synthetic trees Otherwise returns a synthetic offset position to point.
A position that wraps a set of trees.
A position that wraps a set of trees. The point of the wrapping position is the point of the default position. If some of the trees are ranges, returns a range position enclosing all ranges Otherwise returns default position that is either focused or not.
Hook for extensions
Hook for extensions
Provides an extension hook for the transformation strategy.
Provides an extension hook for the transformation strategy. Future-proofs against new node types.
Provides an extension hook for the traversal strategy.
Provides an extension hook for the traversal strategy. Future-proofs against new node types.
(javaUniverse: StringAdd).self
(javaUniverse: StringFormat).self
(Since version 2.10.0) Give us a reason
(Since version 2.10.0) Moved to tree.duplicate
(Since version 2.10.0) The compiler doesn't use this so you shouldn't either - it will be removed
A creator for type parameterizations that strips empty type parameter lists.
A creator for type parameterizations that strips empty type parameter lists. Use this factory method to indicate the type has kind * (it's a polymorphic value) until we start tracking explicit kinds equivalent to typeFun (except that the latter requires tparams nonEmpty).
(Since version 2.10.0) use genPolyType(...) instead
(Since version 2.9.0)
(javaUniverse: ArrowAssoc[JavaUniverse]).x
(Since version 2.10.0) Use leftOfArrow
instead
(javaUniverse: Ensuring[JavaUniverse]).x
(Since version 2.10.0) Use resultOfEnsuring
instead
An implementation of scala.reflect.api.Universe for runtime reflection using JVM classloaders.
Should not be instantiated directly, use scala.reflect.runtime.universe instead.