A type carrying some annotations.
An additional checker for annotations on types.
Typed information about an annotation.
A class remembering a type instantiation for some a set of overloaded polymorphic symbols.
Represents an array of classfile annotation arguments
A map to compute the asSeenFrom method
Either an assignment or a named argument.
A class representing a class info
A class for class symbols
Arguments to classfile annotations (which are written to bytecode as java annotations) are either:
A tree printer which is stingier about vertical whitespace and unnecessary punctuation than the standard one.
One unit of compilation that has been submitted to the compiler.
This should be the first trait in the linearization.
A common base class for intersection types and class types
A class representing a constant type.
A map to implement the contains' method
A map to implement the contains' method
A collector that tests for existential types appearing at given variance in a type
An exception for cyclic references of symbol definitions
Aux datastructure for solving the constraint system The depency graph container with helper methods for node and edge creation
Documented definition, eliminated by analyzer
The error scope.
A map to implement the filter' method
A map to implement the filter' method
Symbol annotations parsed in Namer
(typeCompleter of
definitions) have to be lazy (#1782)
A class representing an as-yet unevaluated type.
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).
A throwable signalling a malformed type
A class for method symbols
A class representing a method type with parameters.
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 symbols
The name class.
A class representing types with a name.
Represents a nested classfile annotation
A class containing the alternatives and type prefix of an overloaded symbol.
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 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 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.
A Run is a single execution of the compiler on a sets of units
An ordinal number for compiler runs.
An ordinal number for compiler runs. First run has number 1.
This must guarantee not to force any evaluation, so we can learn a little bit about trees in the midst of compilation without altering the natural course of events.
A specific annotation argument that encodes an array of bytes as an
array of Long
.
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>.
A base class for types that represent a single value (single-types and this-types).
A base class for types that defer some operations to their immediate supertype.
A base class to compute all substitutions
A map to implement the substSym' method.
A map to implement the substThis' method.
A map to implement the subst' method.
The class for all symbols
A class for term symbols
A class for this-types of the form <sym>.
Substitute symbols in 'from' with symbols in 'to'.
The base class for all types
A class for the bounds of abstract types and type parameters
A class expressing upper and lower bounds constraints of type variables, as well as their instantiations.
A throwable signalling a type error
A prototype for mapping a function over all possible types
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 type parameters viewed from inside their scopes
A class of type symbols.
A synthetic term holding an arbitrary type.
emitted by typer, eliminated by refchecks
A class representing a type variable
Not used after phase typer'.
A higher-kinded type variable has type arguments (a list of Type's) and type parameters (list of Symbols)
A TypeVar whose list of args is non-empty can only be instantiated by a higher-kinded type that can be applied to these args
a typevar is much like a typeref, except it has special logic for type equality/subtyping
An exception signalling a variance annotation/usage conflict
Block factory that flattens directly nested blocks.
Block factory that flattens directly nested blocks.
casedef shorthand
casedef shorthand
Construct class definition with given class symbol, value parameters, supercall arguments and template body.
Construct class definition with given class symbol, value parameters, supercall arguments and template body.
the class symbol
the modifiers for the class constructor, i.e. as in class C private (...)'
the value parameters -- if they have symbols they
should be owned by sym'
the supercall arguments
the template statements without primary constructor and value parameter fields.
the class symbol
the implementation template
A writer that writes to the current Console and is sensitive to replacement of the Console's output stream.
The empty scope (immutable).
A map to implement the contains' method
An object representing an erroneous type
A type map that always returns the input type unchanged
The canonical creator for implicit method types
The canonical creator for implicit method types
the class symbol
the implementation template
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)
An object representing a non-existing prefix
An object representing a missing symbol
An object representing a non-existing type
Generates a template with constructor corresponding to
Generates a template with constructor corresponding to
constrmods (vparams1_) ... (vparams_n) preSuper { presupers } extends superclass(args_1) ... (args_n) with mixins { self => body }
This gets translated to
extends superclass with mixins { self => presupers' // presupers without rhs vparamss // abstract fields corresponding to value parameters def <init>(vparamss) { presupers super.<init>(args) } body }
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'.
An object representing an unknown type, used during type inference.
Let registered annotation checkers adapt a tree to a given type (called by Typers.
Let registered annotation checkers adapt a tree to a given type (called by Typers.adapt). Annotation checkers that cannot do the adaption should pass the tree through unchanged.
Refine the bounds on type parameters to the given type arguments.
Refine the bounds on type parameters to the given type arguments.
Let a registered annotation checker adapt the type of a return expression.
Let a registered annotation checker adapt the type of a return expression.
Annotation checkers that cannot do the adaptation should simply return
the default
argument.
Note that the result is undefined if more than one annotation checker
returns an adapted type which is not a subtype of default
.
Register an annotation checker.
Register an annotation checker. Typically these are added by compiler plugins.
Let all annotations checkers add extra annotations to this tree's type.
Let all annotations checkers add extra annotations to this tree's type.
Make symbol sym' a member of scope
tp.
Make symbol sym' a member of scope
tp.decls'
where thistp' is the narrowed owner type of the scope.
ICode analysis for optimization
Check that the annotations on two types conform.
Check that the annotations on two types conform. To do so, consult all registered annotation checkers.
Refine the computed greatest lower bound of a list of types.
Refine the computed greatest lower bound of a list of types. All this should do is add annotations.
Refine the computed least upper bound of a list of types.
Refine the computed least upper bound of a list of types. All this should do is add annotations.
A creator for type applications
A creator for type applications
Perform given operation at given phase
Perform given operation at given phase
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
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 (wrt) =:= prefixes are considered equal wrt =:=
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 (wrt) =:= prefixes are considered equal wrt =:=
Find out whether any annotation checker can adapt a tree to a given type.
Find out whether any annotation checker can adapt a tree to a given type. Called by Typers.adapt.
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
A map to compute the most deeply nested owner that contains all the symbols of thistype or prefixless typerefs/singletype occurrences in given type.
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
Add the internal compiler phases to the phases set.
Add the internal compiler phases to the phases set. This implementation creates a description map at the same time.
Extract all phases supplied by plugins and add them to the phasesSet.
Extract all phases supplied by plugins and add them to the phasesSet.
phasesSet
Fold constants
The raw doc comment of symbol sym
, minus @usecase and @define sections, augmented by
missing sections of an inherited doc comment.
The raw doc comment of symbol sym
, minus @usecase and @define sections, augmented by
missing sections of an inherited doc comment.
If a symbol does not have a doc comment but some overridden version of it does,
the doc comment of the overridden version is copied instead.
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
Copy propagation for optimization
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.
The current period
The current period
The currently active run
The currently active run
The id of the currently active run
The id of the currently active run
Remove any occurrences of type aliases from this type
Associate comment with symbol sym
at position pos
.
Associate comment with symbol sym
at position pos
.
The position of the raw doc comment of symbol sym
, or NoPosition if missing
If a symbol does not have a doc comment but some overridden version of it does,
the position of the doc comment of the overridden version is returned instead.
The position of the raw doc comment of symbol sym
, or NoPosition if missing
If a symbol does not have a doc comment but some overridden version of it does,
the position of the doc comment of the overridden version is returned instead.
The raw doc comment map
The raw doc comment map
Remove any occurrence of type <singleton> from this type and its parents
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 or assigning TransparentPositions
to some of the nodes in tree
.
A creator for existential types.
A creator for existential types. This generates:
tpe1 where { tparams }
where tpe1' is the result of extrapolating
tpe' wrt 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 wrt 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'.
Expand variable occurrences in string str', until a fix point is reached or
a expandLimit is exceeded.
Expand variable occurrences in string str', until a fix point is reached or
a expandLimit is exceeded.
The symbol for which doc comments are generated
The class for which doc comments are generated
Expanded string
Returns just the wiki expansion (this would correspond to a comment in the input format of the JavaDoc tool, modulo differences in tags.
Returns just the wiki expansion (this would correspond to a comment in the input format of the JavaDoc tool, modulo differences in tags.)
The cooked doc comment of symbol sym
after variable expansion, or "" if missing.
The cooked doc comment of symbol sym
after variable expansion, or "" if missing.
The symbol for which doc comment is returned (site is always the containing class)
The cooked doc comment of symbol sym
after variable expansion, or "" if missing.
The cooked doc comment of symbol sym
after variable expansion, or "" if missing.
The symbol for which doc comment is returned
The class for which doc comments are generated
when more than 10 successive expansions of the same string are done, which is interpreted as a recursive variable definition.
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'.
Are we compiling for Java SE ?
Are we compiling for Java SE ?
Are we compiling for .
Are we compiling for .NET ?
Generate ASTs
Returns the file with the given suffix for the given class.
Returns the file with the given suffix for the given class. Used for icode writing.
Again avoiding calling length, but the lengthCompare interface is clunky.
Again avoiding calling length, but the lengthCompare interface is clunky.
Icode verification
ICode generator
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.
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.
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
Is type tp a raw type?
Is type tp a raw type?
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'?
Do type arguments targs' conform to formal parameters
tparams'?
Do type arguments targs' conform to formal parameters
tparams'?
...
...
...
Load all available plugins.
Load all available plugins. Skips plugins that either have the same name as another one, or which define a phase name that another one does.
Load a rough list of the plugins.
Load a rough list of the plugins. For speed, it does not instantiate a compiler run. Therefore it cannot test for same-named phases or other problems that are filtered from the final list of plugins.
Lookup definition of variable.
Lookup definition of variable.
The variable for which a definition is searched
The class for which doc comments are generated
The least upper bound wrt <:< of a list of types
The least upper bound wrt <:< of a list of types
The maximum allowable depth of lubs or glbs over types ts'
This is the maximum depth of all types in the base type sequences
of each of the types
ts', plus LubGlbMargin
The maximum allowable depth of lubs or glbs over types ts'
This is the maximum depth of all types in the base type sequences
of each of the types
ts', plus LubGlbMargin
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 function implementing tp1' matches
tp2'
A function implementing tp1' matches
tp2'
Merge elements of doccomment src
into doc comment dst
for symbol sym
.
Merge elements of doccomment src
into doc comment dst
for symbol sym
.
In detail:
copyFirstPara
is true, copy first paragraph
2. For all parameters of sym
if there is no @param section
in dst
for that parameter name, but there is one on src
, copy that section.
3. If there is no @return section in dst
but there is one in src
, copy it.
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.
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.
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'?
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 string
create a term name from string
Create a term name from the characters in cs[offset.
Create a term name from the characters in cs[offset..offset+len-1].
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 string
Create a type name from string
Create a type name from the characters in cs[offset.
Create a type name from the characters in cs[offset..offset+len-1].
Print tree in detailed form
The original owner of a class.
The original owner of a class. Used by the backend to generate EnclosingMethod attributes.
Computing pairs of overriding/overridden symbols
A description of the phases that will run
A description of the phases that will run
The phase identifier of the given period
The phase identifier of the given period
The names of the phases.
The names of the phases.
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
A description of all the plugins that are loaded
A description of all the plugins that are loaded
Summary of the options for all loaded plugins
Summary of the options for all loaded plugins
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)
Switch to turn on detailed type logs
Switch to turn on detailed type logs
Adds backticks if the name is a scala keyword.
Adds backticks if the name is a scala keyword.
The raw doc comment of symbol sym
, as it appears in the source text, "" if missing.
The raw doc comment of symbol sym
, as it appears in the source text, "" if missing.
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)
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
Register new context; called for every created context
Register new context; called for every created context
Register top level class (called on entering the class)
Register top level class (called on entering the class)
Remove all annotation checkers
Remove all annotation checkers
resets symbol and tpe fields in a tree, @see ResetAttrsTraverse
resets symbol and tpe fields in a tree, @see ResetAttrsTraverse
The run identifier of the given period
The run identifier of the given period
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.
Scala primitives, used in genicode
We resolve the class/object ambiguity by passing a type/term name.
We resolve the class/object ambiguity by passing a type/term name.
Called every time an AST node is successfully typechecked in typerPhase.
Called every time an AST node is successfully typechecked in typerPhase.
Called from parser, which signals hereby that a method definition has been parsed.
Called from parser, which signals hereby that a method definition has been parsed.
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'
Some statistics (normally disabled) set with -Ystatistics
The cooked doc comment of an overridden symbol
The cooked doc comment of an overridden symbol
Returns the javadoc format of doc comment string s
, including wiki expansion
Returns the javadoc format of doc comment string s
, including wiki expansion
Representing ASTs as graphs
Tree checker
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?
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
A map to convert every occurrence of a type variable to a wildcard 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.
The list of use cases of doc comment of symbol sym
seen as a member of class
site
.
The list of use cases of doc comment of symbol sym
seen as a member of class
site
. Each use case consists of a synthetic symbol (which is entered nowhere else),
of an expanded doc comment string, and of its position.
The symbol for which use cases are returned
The class for which doc comments are generated
when more than 10 successive expansions of the same string are done, which is interpreted as a recursive variable definition.
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 all some 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.