Checker
Type members
Inherited classlikes
Subclass of Application for applicability tests with type arguments and value argument trees.
Subclass of Application for applicability tests with type arguments and value argument trees.
- Inherited from
- Applications
Subclass of Application for applicability tests with value argument types.
Subclass of Application for applicability tests with value argument types.
- Inherited from
- Applications
- Type Params
- Arg
the type of arguments, could be tpd.Tree, untpd.Tree, or Type
- Value Params
- args
the arguments of the application
- funType
the type of the function part of the application
- methRef
the reference to the method of the application
- resultType
the expected result type of the application
- Inherited from
- Applications
Subclass of Application for type checking an Apply node with typed arguments.
Subclass of Application for type checking an Apply node with typed arguments.
- Inherited from
- Applications
Subclass of Application for type checking an Apply node with untyped arguments.
Subclass of Application for type checking an Apply node with untyped arguments.
- Inherited from
- Applications
The degree to which an argument has to match a formal parameter
The degree to which an argument has to match a formal parameter
- Inherited from
- Applications
The completer of a symbol defined by a member def or import (except ClassSymbols)
The completer of a symbol defined by a member def or import (except ClassSymbols)
- Inherited from
- Namer
A helper class to derive type class instances for one class or object
A helper class to derive type class instances for one class or object
- Value Params
- cls
The class symbol of the class or object with a
derives
clause- codePos
The default position that should be given to generic synthesized infrastructure code that is not connected with a
derives
instance.
- Inherited from
- Deriving
An implicit search; parameters as in inferImplicit
An implicit search; parameters as in inferImplicit
- Inherited from
- Implicits
Subclass of Application for the cases where we are interested only in a "can/cannot apply" answer, without needing to construct trees or issue error messages.
Subclass of Application for the cases where we are interested only in a "can/cannot apply" answer, without needing to construct trees or issue error messages.
- Inherited from
- Applications
Subclass of Application for type checking an Apply node, where types of arguments are either known or unknown.
Subclass of Application for type checking an Apply node, where types of arguments are either known or unknown.
- Inherited from
- Applications
Value members
Concrete methods
- Definition Classes
- Definition Classes
Exclude from double definition checks any erased symbols that were
made private
in phase UnlinkErasedDecls
. These symbols will be removed
completely in phase Erasure
if they are defined in a currently compiled unit.
Exclude from double definition checks any erased symbols that were
made private
in phase UnlinkErasedDecls
. These symbols will be removed
completely in phase Erasure
if they are defined in a currently compiled unit.
- Definition Classes
Makes sure the symbol in the tree can be approximately reconstructed by
calling member
on the qualifier type.
Approximately means: The two symbols might be different but one still overrides the other.
Check that all defined symbols have legal owners. An owner is legal if it is either the same as the context's owner or there's an owner chain of valdefs starting at the context's owner and reaching up to the symbol's owner. The reason for this relaxed matching is that we should be able to pull out an expression as an initializer of a helper value without having to do a change owner traversal of the expression.
Check that all defined symbols have legal owners. An owner is legal if it is either the same as the context's owner or there's an owner chain of valdefs starting at the context's owner and reaching up to the symbol's owner. The reason for this relaxed matching is that we should be able to pull out an expression as an initializer of a helper value without having to do a change owner traversal of the expression.
- Definition Classes
Inherited methods
Typecheck an Apply node with a typed function and possibly-typed arguments coming from proto
Typecheck an Apply node with a typed function and possibly-typed arguments coming from proto
- Inherited from
- Applications
If tpe
is a named type, return the type with those alternatives as denotations
which are accessible (or NoType, if no alternatives are accessible).
If tpe
is a named type, return the type with those alternatives as denotations
which are accessible (or NoType, if no alternatives are accessible).
Also performs the following normalizations on the type tpe
.
(1) if the owner of the denotation is a package object, it is assured
that the package object shows up as the prefix.
(2) in Java compilation units, Object
is replaced by defn.FromJavaObjectType
- Inherited from
- TypeAssigner
Tries to adapt NotNullInfos from creation context to the DefTree, returns whether the adaption took place. An adaption only takes place if the DefTree has a symbol and it has not been completed (is not forward referenced).
Tries to adapt NotNullInfos from creation context to the DefTree, returns whether the adaption took place. An adaption only takes place if the DefTree has a symbol and it has not been completed (is not forward referenced).
- Inherited from
- Typer
Add child annotation for child
to annotations of cls
. The annotation
is added at the correct insertion point, so that Child annotations appear
in reverse order of their start positions.
Add child annotation for child
to annotations of cls
. The annotation
is added at the correct insertion point, so that Child annotations appear
in reverse order of their start positions.
- Inherited from
- Namer
The context to be used for an annotation of mdef
.
This should be the context enclosing mdef
, or if mdef
defines a parameter
the context enclosing the owner of mdef
.
Furthermore, we need to evaluate annotation arguments in an expression context,
since classes defined in a such arguments should not be entered into the
enclosing class.
The context to be used for an annotation of mdef
.
This should be the context enclosing mdef
, or if mdef
defines a parameter
the context enclosing the owner of mdef
.
Furthermore, we need to evaluate annotation arguments in an expression context,
since classes defined in a such arguments should not be entered into the
enclosing class.
- Inherited from
- Typer
If app
is a this(...)
constructor call, the this-call argument context,
otherwise the current context.
If app
is a this(...)
constructor call, the this-call argument context,
otherwise the current context.
- Inherited from
- Applications
- Inherited from
- TypeAssigner
- Inherited from
- TypeAssigner
- Inherited from
- TypeAssigner
- Inherited from
- TypeAssigner
Assign type of RefinedType.
Refinements are typed as if they were members of refinement class refineCls
.
Assign type of RefinedType.
Refinements are typed as if they were members of refinement class refineCls
.
- Inherited from
- TypeAssigner
Type assignment method. Each method takes as parameters
Type assignment method. Each method takes as parameters
- an untpd.Tree to which it assigns a type,
- typed child trees it needs to access to cpmpute that type,
- any further information it needs to access to compute that type.
- Inherited from
- TypeAssigner
A CanEqual[T, U] instance is assumed
A CanEqual[T, U] instance is assumed
- if one of T, U is an error type, or
- if one of T, U is a subtype of the lifted version of the other, unless strict equality is set.
- Inherited from
- Implicits
Check arguments of compiler-defined annotations
Check arguments of compiler-defined annotations
- Inherited from
- Checking
Check that case classes are not inherited by case classes.
Check that case classes are not inherited by case classes.
- Inherited from
- Checking
Check that tp
is a class type.
Also, if traitReq
is true, check that tp
is a trait.
Also, if stablePrefixReq
is true and phase is not after RefChecks,
check that class prefix is stable.
Check that tp
is a class type.
Also, if traitReq
is true, check that tp
is a trait.
Also, if stablePrefixReq
is true and phase is not after RefChecks,
check that class prefix is stable.
- Returns
tp
itself if it is a class or trait ref, ObjectType if not.- Inherited from
- Checking
Check that tp
is a class type and that any top-level type arguments in this type
are feasible, i.e. that their lower bound conforms to their upper bound. If a type
argument is infeasible, issue and error and continue with upper bound.
Check that tp
is a class type and that any top-level type arguments in this type
are feasible, i.e. that their lower bound conforms to their upper bound. If a type
argument is infeasible, issue and error and continue with upper bound.
- Inherited from
- Checking
Issue a feature warning if feature is not enabled
Issue a feature warning if feature is not enabled
- Inherited from
- Checking
If sym
is an old-style implicit conversion, check that implicit conversions are enabled.
If sym
is an old-style implicit conversion, check that implicit conversions are enabled.
- Inherited from
- Checking
If tree
is an application of a new-style implicit conversion (using the apply
method of a scala.Conversion
instance), check that implicit conversions are
enabled.
If tree
is an application of a new-style implicit conversion (using the apply
method of a scala.Conversion
instance), check that implicit conversions are
enabled.
- Inherited from
- Checking
Check that we are in an inline context (inside an inline method or in inline code)
Check that we are in an inline context (inside an inline method or in inline code)
- Inherited from
- Checking
Check that pattern pat
is irrefutable for scrutinee type sel.tpe
.
This means sel
is either marked @unchecked or sel.tpe
conforms to the
pattern's type. If pattern is an UnApply, do the check recursively.
Check that pattern pat
is irrefutable for scrutinee type sel.tpe
.
This means sel
is either marked @unchecked or sel.tpe
conforms to the
pattern's type. If pattern is an UnApply, do the check recursively.
- Inherited from
- Checking
Check that path
is a legal prefix for an export clause
Check that path
is a legal prefix for an export clause
- Inherited from
- Checking
Check that path
is a legal prefix for an import clause
Check that path
is a legal prefix for an import clause
- Inherited from
- Checking
Check that all named types that form part of this type have a denotation.
Called on inferred (result) types of ValDefs and DefDefs.
This could fail for types where the member was originally available as part
of the self type, yet is no longer visible once the this
has been replaced
by some other prefix. See neg/i3083.scala
Check that all named types that form part of this type have a denotation.
Called on inferred (result) types of ValDefs and DefDefs.
This could fail for types where the member was originally available as part
of the self type, yet is no longer visible once the this
has been replaced
by some other prefix. See neg/i3083.scala
- Inherited from
- Checking
Check that a new definition with given name and privacy status in current context would not conflict with existing currently compiled definitions. The logic here is very subtle and fragile due to the fact that we are not allowed to force anything.
Check that a new definition with given name and privacy status in current context would not conflict with existing currently compiled definitions. The logic here is very subtle and fragile due to the fact that we are not allowed to force anything.
- Inherited from
- Namer
Check that class does not declare same symbol twice
Check that class does not declare same symbol twice
- Inherited from
- Checking
Check that method parameter types do not reference their own parameter or later parameters in the same parameter section.
Check that method parameter types do not reference their own parameter or later parameters in the same parameter section.
- Inherited from
- Checking
Check that symbol's external name does not clash with symbols defined in the same scope
Check that symbol's external name does not clash with symbols defined in the same scope
- Inherited from
- Checking
- Inherited from
- Checking
Check that all type members of tp
have realizable bounds
Check that all type members of tp
have realizable bounds
- Inherited from
- Checking
- Definition Classes
- Inherited from
- ReChecking
Check that tpt
does not define a higher-kinded type
Check that tpt
does not define a higher-kinded type
- Inherited from
- Checking
Given a parent parent
of a class cls
, if parent
is a trait check that
the superclass of cls
derived from the superclass of parent
.
Given a parent parent
of a class cls
, if parent
is a trait check that
the superclass of cls
derived from the superclass of parent
.
An exception is made if cls
extends Any
, and parent
is java.io.Serializable
or java.lang.Comparable
. These two classes are treated by Scala as universal
traits. E.g. the following is OK:
... extends Any with java.io.Serializable
The standard library relies on this idiom.
- Inherited from
- Checking
Check that tree
is a valid infix operation. That is, if the
operator is alphanumeric, it must be declared infix
.
Check that tree
is a valid infix operation. That is, if the
operator is alphanumeric, it must be declared infix
.
- Inherited from
- Checking
Compare to alternatives of an overloaded call or an implicit search.
Compare to alternatives of an overloaded call or an implicit search.
- Value Params
- alt1,
alt2 Non-overloaded references indicating the two choices
- Returns
1 if 1st alternative is preferred over 2nd -1 if 2nd alternative is preferred over 1st 0 if neither alternative is preferred over the other Normal symbols are always preferred over constructor proxies. Otherwise, an alternative A1 is preferred over an alternative A2 if it wins in a tournament that awards one point for each of the following:
- A1's owner derives from A2's owner.
- A1's type is more specific than A2's type. If that tournament yields a draw, a tiebreak is applied where an alternative that takes more implicit parameters wins over one that takes fewer.
- Inherited from
- Applications
Compare owner inheritance level.
Compare owner inheritance level.
- Value Params
- sym1
The first owner
- sym2
The second owner
- Returns
1 if
sym1
properly derives fromsym2
-1 ifsym2
properly derives fromsym1
0 otherwise Module classes also inherit the relationship from their companions. This means, if no direct derivation exists betweensym1
andsym2
also perform the following tests:- If both sym1 and sym1 are module classes that have companion classes, and sym2 does not inherit implicit members from a base class (#), compare the companion classes.
- If sym1 is a module class with a companion, and sym2 is a normal class or trait,
compare the companion with sym2.
Condition (#) is necessary to make
compareOwner(_, _) > 0
a transitive relation. For instance: class A extends B object A { given a ... } class B object B extends C { given b ... } class C { given c } Then without (#), and taking A$ for the module class of A, compareOwner(A$, B$) = 1 and compareOwner(B$, C) == 1, but compareOwner(A$, C) == 0. Violating transitivity in this way is bad, since it makes implicit search outcomes compilation order dependent. E.g. if we compareb
withc
first, we pickb
. Then, if we comparea
andb
, we picka
as solution of the search. But if we start with comparinga
withc
, we get an ambiguity. With the added condition (#), compareOwner(A$, B$) == 0. This means we get an ambiguity betweena
andb
in all cases.
- Inherited from
- Applications
Constrain result with special case if meth
is an inlineable method in an inlineable context.
In that case, we should always succeed and not constrain type parameters in the expected type,
because the actual return type can be a subtype of the currently known return type.
However, we should constrain parameters of the declared return type. This distinction is
achieved by replacing expected type parameters with wildcards.
Constrain result with special case if meth
is an inlineable method in an inlineable context.
In that case, we should always succeed and not constrain type parameters in the expected type,
because the actual return type can be a subtype of the currently known return type.
However, we should constrain parameters of the declared return type. This distinction is
achieved by replacing expected type parameters with wildcards.
- Inherited from
- Compatibility
Check that the result type of the current method fits the given expected result type.
Check that the result type of the current method fits the given expected result type.
- Inherited from
- Compatibility
Rewrite new Array[T](....)
if T is an unbounded generic to calls to newGenericArray.
It is performed during typer as creation of generic arrays needs a classTag.
we rely on implicit search to find one.
Rewrite new Array[T](....)
if T is an unbounded generic to calls to newGenericArray.
It is performed during typer as creation of generic arrays needs a classTag.
we rely on implicit search to find one.
- Inherited from
- Applications
If this tree is a member def or an import, create a symbol of it and store in symOfTree map.
If this tree is a member def or an import, create a symbol of it and store in symOfTree map.
- Inherited from
- Namer
The type signature of a DefDef with given symbol
The type signature of a DefDef with given symbol
- Inherited from
- Namer
The enclosing class with given name; error if none exists
The enclosing class with given name; error if none exists
- Inherited from
- Namer
Try to make tpe
accessible, emit error if not possible
Try to make tpe
accessible, emit error if not possible
- Inherited from
- TypeAssigner
If this is a real class, make sure its first parent is a constructor call. Cannot simply use a type. Overridden in ReTyper.
If this is a real class, make sure its first parent is a constructor call. Cannot simply use a type. Overridden in ReTyper.
- Inherited from
- Typer
If sym
exists, enter it in effective scope. Check that
package members are not entered twice in the same run.
If sym
exists, enter it in effective scope. Check that
package members are not entered twice in the same run.
- Inherited from
- Namer
The expanded version of this tree, or tree itself if not expanded
The expanded version of this tree, or tree itself if not expanded
- Inherited from
- Namer
Find the type of an identifier with given name
in given context ctx
.
Find the type of an identifier with given name
in given context ctx
.
- Value Params
- excluded
flags the result's symbol must not have
- name
the name of the identifier
- pos
indicates position to use for error reporting
- pt
the expected type
- required
flags the result's symbol must have
- Inherited from
- Typer
Handle reflection-based dispatch for members of structural types.
Handle reflection-based dispatch for members of structural types.
Given x.a
, where x
is of (widened) type T
(a value type or a nullary method type),
and x.a
is of type U
, map x.a
to the equivalent of:
x1.selectDynamic("a").asInstanceOf[U]
where x1
is x
adapted to Selectable
.
Given x.a(a11, ..., a1n)...(aN1, ..., aNn)
, where x.a
is of (widened) type
(T11, ..., T1n)...(TN1, ..., TNn): R
, it is desugared to:
x1.applyDynamic("a")(a11, ..., a1n, ..., aN1, ..., aNn)
.asInstanceOf[R]
If this call resolves to an applyDynamic
method that takes a Class[?]*
as second
parameter, we further rewrite this call to
scala```
x1.applyDynamic("a", c11, ..., c1n, ..., cN1, ... cNn)
(a11, ..., a1n, ..., aN1, ..., aNn)
.asInstanceOf[R]
where c11, ..., cNn are the classOf constants representing the erasures of T11, ..., TNn.
It's an error if U is neither a value nor a method type, or a dependent method
type
- Inherited from
- Dynamic
Apply a transformation harmonize
on the results of operation op
,
unless the expected type pt
is fully defined.
If the result is different (wrt eq) from the original results of op
,
revert back to the constraint in force before computing op
.
This reset is needed because otherwise the original results might
have added constraints to type parameters which are no longer
implied after harmonization. No essential constraints are lost by this because
the result of harmomization will be compared again with the expected type.
Test cases where this matters are in pos/harmomize.scala.
Apply a transformation harmonize
on the results of operation op
,
unless the expected type pt
is fully defined.
If the result is different (wrt eq) from the original results of op
,
revert back to the constraint in force before computing op
.
This reset is needed because otherwise the original results might
have added constraints to type parameters which are no longer
implied after harmonization. No essential constraints are lost by this because
the result of harmomization will be compared again with the expected type.
Test cases where this matters are in pos/harmomize.scala.
- Inherited from
- Applications
If trees
all have numeric value types, and they do not have all the same type,
pick a common numeric supertype and try to convert all constant Int literals to this type.
If the resulting trees all have the same type, return them instead of the original ones.
If trees
all have numeric value types, and they do not have all the same type,
pick a common numeric supertype and try to convert all constant Int literals to this type.
If the resulting trees all have the same type, return them instead of the original ones.
- Inherited from
- Applications
Does tp
have an extension method named xname
with this-argument argType
and
result matching resultType
?
Does tp
have an extension method named xname
with this-argument argType
and
result matching resultType
?
- Inherited from
- Applications
True if this inline typer has already issued errors
True if this inline typer has already issued errors
- Inherited from
- Typer
Search an implicit argument and report error if not found
Search an implicit argument and report error if not found
- Inherited from
- Implicits
A string indicating the formal parameter corresponding to a missing argument
A string indicating the formal parameter corresponding to a missing argument
- Inherited from
- Implicits
The type bound on wildcard imports of an import list, with special values Nothing if no wildcard imports of this kind exist Any if there are unbounded wildcard imports of this kind
The type bound on wildcard imports of an import list, with special values Nothing if no wildcard imports of this kind exist Any if there are unbounded wildcard imports of this kind
- Inherited from
- Namer
An addendum to an error message where the error might be fixed
by some implicit value of type pt
that is however not found.
The addendum suggests given imports that might fix the problem.
If there's nothing to suggest, an empty string is returned.
An addendum to an error message where the error might be fixed
by some implicit value of type pt
that is however not found.
The addendum suggests given imports that might fix the problem.
If there's nothing to suggest, an empty string is returned.
- Definition Classes
- Inherited from
- ImportSuggestions
Expand tree and create top-level symbols for statement and enter them into symbol table
Expand tree and create top-level symbols for statement and enter them into symbol table
- Inherited from
- Namer
Create top-level symbols for all statements in the expansion of this statement and enter them into symbol table
Create top-level symbols for all statements in the expansion of this statement and enter them into symbol table
- Inherited from
- Namer
Find an implicit parameter or conversion.
Find an implicit parameter or conversion.
- Value Params
- argument
If an implicit conversion is searched, the argument to which it should be applied, EmptyTree otherwise.
- pt
The expected type of the parameter or conversion.
- span
The position where errors should be reported.
- Inherited from
- Implicits
Find an implicit argument for parameter formal
.
Return a failure as a SearchFailureType in the type of the returned tree.
Find an implicit argument for parameter formal
.
Return a failure as a SearchFailureType in the type of the returned tree.
- Inherited from
- Implicits
If the prototype pt
is the type lambda (when doing a dependent
typing of a match), instantiate that type lambda with the pattern
variables found in the pattern pat
.
If the prototype pt
is the type lambda (when doing a dependent
typing of a match), instantiate that type lambda with the pattern
variables found in the pattern pat
.
- Inherited from
- Typer
Interpolate undetermined type variables in the widened type of this tree.
Interpolate undetermined type variables in the widened type of this tree.
- Value Params
- locked
the set of type variables of the current typer state that cannot be interpolated at the present time Eligible for interpolation are all type variables owned by the current typerstate that are not in locked. Type variables occurring co- (respectively, contra-) variantly in the type are minimized (respectvely, maximized). Non occurring type variables are minimized if they have a lower bound different from Nothing, maximized otherwise. Type variables appearing non-variantly in the type are left untouched. Note that even type variables that do not appear directly in a type, can occur with some variance in the type, because of the constraints. E.g if
X
occurs co-variantly inT
and we have a constraint Y <: X ThenY
also occurs co-variantly inT
because it needs to be minimized in order to constrainT
the least. Seevariances
for more detail.- pt
the expected result type
- tree
the tree whose type is interpolated
- Inherited from
- Inferencing
For all class definitions stat
in xstats
: If the companion class is
not also defined in xstats
, invalidate it by setting its info to
NoType.
For all class definitions stat
in xstats
: If the companion class is
not also defined in xstats
, invalidate it by setting its info to
NoType.
- Inherited from
- Namer
Is given method reference applicable to argument types args
?
Is given method reference applicable to argument types args
?
- Value Params
- resultType
The expected result type of the application
- Inherited from
- Applications
Is given method reference applicable to argument trees args
?
Is given method reference applicable to argument trees args
?
- Value Params
- resultType
The expected result type of the application
- Inherited from
- Applications
Is given type applicable to argument types args
, possibly after inserting an apply
?
Is given type applicable to argument types args
, possibly after inserting an apply
?
- Value Params
- resultType
The expected result type of the application
- Inherited from
- Applications
Is given type applicable to argument trees args
, possibly after inserting an apply
?
Is given type applicable to argument trees args
, possibly after inserting an apply
?
- Value Params
- resultType
The expected result type of the application
- Inherited from
- Applications
Is pt
a prototype of an apply
selection, or a parameterless function yielding one?
Is pt
a prototype of an apply
selection, or a parameterless function yielding one?
- Inherited from
- Typer
A type tp
is compatible with a type pt
if one of the following holds:
A type tp
is compatible with a type pt
if one of the following holds:
tp
is a subtype ofpt
pt
is by name parameter type, andtp
is compatible with its underlying type- there is an implicit conversion from
tp
topt
. tp
is a numeric subtype ofpt
(this case applies even if implicit conversions are disabled) Ifpt
is a by-name type, we compare against the underlying type instead.
- Inherited from
- Compatibility
Determines whether this field holds an enum constant.
Determines whether this field holds an enum constant.
- Inherited from
- Namer
Is tp
a unary function type or an overloaded type with with only unary function
types as alternatives?
Is tp
a unary function type or an overloaded type with with only unary function
types as alternatives?
- Inherited from
- Applications
Index symbols in tree
while asserting the lateCompile
flag.
This will cause any old top-level symbol with the same fully qualified
name as a newly created symbol to be replaced.
Index symbols in tree
while asserting the lateCompile
flag.
This will cause any old top-level symbol with the same fully qualified
name as a newly created symbol to be replaced.
- Inherited from
- Namer
Return a potentially skolemized version of qualTpe
to be used
as a prefix when selecting name
.
Return a potentially skolemized version of qualTpe
to be used
as a prefix when selecting name
.
- See also
QualSkolemType, TypeOps#asSeenFrom
- Inherited from
- TypeAssigner
- Value Params
- arg
Tree representing a failed result of implicit search
- paramSymWithMethodCallTree
Symbol of the parameter for which the implicit was searched and tree of the method call that triggered the implicit search
- pt
Type for which an implicit value was searched
- where
Description of where the search was performed. Might be empty
- Inherited from
- Implicits
The signature of a module valdef. This will compute the corresponding module class TypeRef immediately without going through the defined type of the ValDef. This is necessary to avoid cyclic references involving imports and module val defs.
The signature of a module valdef. This will compute the corresponding module class TypeRef immediately without going through the defined type of the ValDef. This is necessary to avoid cyclic references involving imports and module val defs.
- Inherited from
- Namer
Like normalize and then isCompatible, but using a subtype comparison with necessary eithers that does not unnecessarily truncate the constraint space, returning false instead.
Like normalize and then isCompatible, but using a subtype comparison with necessary eithers that does not unnecessarily truncate the constraint space, returning false instead.
- Inherited from
- Compatibility
Should we tuple or untuple the argument before application? If auto-tupling is enabled then
Should we tuple or untuple the argument before application? If auto-tupling is enabled then
- we tuple n-ary arguments where n > 0 if the function consists only of unary alternatives
- we untuple tuple arguments of infix operations if the function does not consist only of unary alternatives.
- Inherited from
- Applications
Test compatibility after normalization.
If keepConstraint
is false, the current constraint set will not be modified by this call.
Test compatibility after normalization.
If keepConstraint
is false, the current constraint set will not be modified by this call.
- Inherited from
- Compatibility
The qualifying class of a this or super with prefix qual
(which might be empty).
The qualifying class of a this or super with prefix qual
(which might be empty).
- Value Params
- packageOk
The qualifier may refer to a package.
- Inherited from
- TypeAssigner
A denotation exists really if it exists and does not point to a stale symbol.
A denotation exists really if it exists and does not point to a stale symbol.
- Inherited from
- TypeAssigner
Record sym
as the symbol defined by tree
Record sym
as the symbol defined by tree
- Inherited from
- Namer
Resolve overloading by mapping to a different problem where each alternative's
type is mapped with f
, alternatives with non-existing types are dropped, and the
expected type is pt
. Map the results back to the original alternatives.
Resolve overloading by mapping to a different problem where each alternative's
type is mapped with f
, alternatives with non-existing types are dropped, and the
expected type is pt
. Map the results back to the original alternatives.
- Inherited from
- Applications
Resolve overloaded alternative alts
, given expected type pt
.
Two trials: First, without implicits or SAM conversions enabled. Then,
if the first finds no eligible candidates, with implicits and SAM conversions enabled.
Resolve overloaded alternative alts
, given expected type pt
.
Two trials: First, without implicits or SAM conversions enabled. Then,
if the first finds no eligible candidates, with implicits and SAM conversions enabled.
- Inherited from
- Applications
Substitute argument type argType
for parameter pref
in type tp
,
skolemizing the argument type if it is not stable and pref
occurs in tp
.
Substitute argument type argType
for parameter pref
in type tp
,
skolemizing the argument type if it is not stable and pref
occurs in tp
.
- Inherited from
- TypeAssigner
Substitute types of all arguments args
for corresponding params
in tp
.
The number of parameters params
may exceed the number of arguments.
In this case, only the common prefix is substituted.
Substitute types of all arguments args
for corresponding params
in tp
.
The number of parameters params
may exceed the number of arguments.
In this case, only the common prefix is substituted.
- Inherited from
- TypeAssigner
Does state
contain a "NotAMember" or "MissingIdent" message as
first pending error message? That message would be
$memberName is not a member of ...
or Not found: $memberName
.
If memberName is empty, any name will do.
Does state
contain a "NotAMember" or "MissingIdent" message as
first pending error message? That message would be
$memberName is not a member of ...
or Not found: $memberName
.
If memberName is empty, any name will do.
- Inherited from
- Applications
The type of the selection tree
, where qual1
is the typed qualifier part.
The type of the selection tree
, where qual1
is the typed qualifier part.
- Inherited from
- TypeAssigner
If tree
's type is a TermRef
identified by flow typing to be non-null, then
cast away tree
s nullability. Otherwise, tree
remains unchanged.
If tree
's type is a TermRef
identified by flow typing to be non-null, then
cast away tree
s nullability. Otherwise, tree
remains unchanged.
Example: If x is a trackable reference and we know x is not null at this point, (x: T | Null) => x.$asInstanceOf$[x.type & T]
- Inherited from
- Typer
Try op1
, if there are errors, try op2
, if op2
also causes errors, fall back
to errors and result of op1
.
Try op1
, if there are errors, try op2
, if op2
also causes errors, fall back
to errors and result of op1
.
- Inherited from
- Typer
Assuming methodRef is a reference to an extension method defined e.g. as
Assuming methodRef is a reference to an extension method defined e.g. as
extension [T1, T2](using A)(using B, C)(receiver: R)(using D) def foo[T3](using E)(f: F): G = ???
return the tree representing methodRef partially applied to the receiver and all the implicit parameters preceding it (A, B, C) with the type parameters of the extension (T1, T2) inferred. None is returned if the implicit search fails for any of the leading implicit parameters or if the receiver has a wrong type (note that in general the type of the receiver might depend on the exact types of the found instances of the proceding implicits). No implicit search is tried for implicits following the receiver or for parameters of the def (D, E).
- Inherited from
- Applications
Given a selection qual.name
, try to convert to an extension method
application name(qual)
or insert an implicit conversion c(qual).name
.
Given a selection qual.name
, try to convert to an extension method
application name(qual)
or insert an implicit conversion c(qual).name
.
- Returns
The converted tree, or
EmptyTree
is not successful.- Inherited from
- Typer
If this tree is a select node qual.name
that does not conform to pt
,
try to insert an implicit conversion c
around qual
so that
c(qual).name
conforms to pt
.
If this tree is a select node qual.name
that does not conform to pt
,
try to insert an implicit conversion c
around qual
so that
c(qual).name
conforms to pt
.
- Inherited from
- Typer
For a typed tree e: T
, if T
is an abstract type for which an implicit type test or class tag tt
exists, rewrite to tt(e)
.
For a typed tree e: T
, if T
is an abstract type for which an implicit type test or class tag tt
exists, rewrite to tt(e)
.
- Inherited from
- Typer
Normalize type T appearing in a new T by following eta expansions to avoid higher-kinded types.
Normalize type T appearing in a new T by following eta expansions to avoid higher-kinded types.
- Inherited from
- TypeAssigner
Typecheck and adapt tree, returning a typed tree. Parameters as for typedUnadapted
Typecheck and adapt tree, returning a typed tree. Parameters as for typedUnadapted
- Inherited from
- Typer
Typecheck tree
during completion using typed
, and remember result in TypedAhead map
Typecheck tree
during completion using typed
, and remember result in TypedAhead map
- Inherited from
- Namer
Types a splice applied to some arguments $f(arg1, ..., argn)
in a quote pattern.
Types a splice applied to some arguments $f(arg1, ..., argn)
in a quote pattern.
The tree is desugared into $f.apply(arg1, ..., argn)
where the expression $f
is expected to type as a function type (T1, ..., Tn) => R
.
Ti
is the type of the argument argi
and R if the type of the prototype.
The prototype must be fully defined to be able to infer the type of R
.
- Inherited from
- QuotesAndSplices
Typecheck application. Result could be an Apply
node,
or, if application is an operator assignment, also an Assign
or
Block node.
Typecheck application. Result could be an Apply
node,
or, if application is an operator assignment, also an Assign
or
Block node.
- Inherited from
- Applications
- Inherited from
- Typer
Special typing of Match tree when the expected type is a MatchType, and the patterns of the Match tree and the MatchType correspond.
Special typing of Match tree when the expected type is a MatchType, and the patterns of the Match tree and the MatchType correspond.
- Inherited from
- Typer
Translate selection that does not typecheck according to the normal rules into a applyDynamic/applyDynamicNamed. foo.bar(baz0, baz1, ...) ~~> foo.applyDynamic(bar)(baz0, baz1, ...) foo.bar[T0, ...](baz0, baz1, ...) ~~> foo.applyDynamicT0, ...(baz0, baz1, ...) foo.bar(x = bazX, y = bazY, baz, ...) ~~> foo.applyDynamicNamed("bar")(("x", bazX), ("y", bazY), ("", baz), ...) foo.bar[T0, ...](x = bazX, y = bazY, baz, ...) ~~> foo.applyDynamicNamedT0, ...(("x", bazX), ("y", bazY), ("", baz), ...)
Translate selection that does not typecheck according to the normal rules into a applyDynamic/applyDynamicNamed. foo.bar(baz0, baz1, ...) ~~> foo.applyDynamic(bar)(baz0, baz1, ...) foo.bar[T0, ...](baz0, baz1, ...) ~~> foo.applyDynamicT0, ...(baz0, baz1, ...) foo.bar(x = bazX, y = bazY, baz, ...) ~~> foo.applyDynamicNamed("bar")(("x", bazX), ("y", bazY), ("", baz), ...) foo.bar[T0, ...](x = bazX, y = bazY, baz, ...) ~~> foo.applyDynamicNamedT0, ...(("x", bazX), ("y", bazY), ("", baz), ...)
- Inherited from
- Dynamic
Translate selection that does not typecheck according to the normal rules into a updateDynamic. foo.bar = baz ~~> foo.updateDynamic(bar)(baz)
Translate selection that does not typecheck according to the normal rules into a updateDynamic. foo.bar = baz ~~> foo.updateDynamic(bar)(baz)
- Inherited from
- Dynamic
Translate selection that does not typecheck according to the normal rules into a selectDynamic. foo.bar ~~> foo.selectDynamic(bar) foo.bar[T0, ...] ~~> foo.selectDynamicT0, ...
Translate selection that does not typecheck according to the normal rules into a selectDynamic. foo.bar ~~> foo.selectDynamic(bar) foo.bar[T0, ...] ~~> foo.selectDynamicT0, ...
Note: inner part of translation foo.bar(baz) = quux ~~> foo.selectDynamic(bar).update(baz, quux) is achieved through an existing transformation of in typedAssign [foo.bar(baz) = quux ~~> foo.bar.update(baz, quux)].
- Inherited from
- Dynamic
Try to typecheck an implicit reference
Try to typecheck an implicit reference
- Inherited from
- Implicits
Translate infix operation expression l op r
to
Translate infix operation expression l op r
to
l.op(r) if op
is left-associative
{ val x = l; r.op(x) } if op
is right-associative call-by-value and l
is impure
r.op(l) if op
is right-associative call-by-name or l
is pure
Translate infix type l op r
to op[l, r]
Translate infix pattern l op r
to op(l, r)
- Inherited from
- Typer
- Inherited from
- Typer
Translate '{ e }
into scala.quoted.Expr.apply(e)
and '[T]
into scala.quoted.Type.apply[T]
while tracking the quotation level in the context.
Translate '{ e }
into scala.quoted.Expr.apply(e)
and '[T]
into scala.quoted.Type.apply[T]
while tracking the quotation level in the context.
- Inherited from
- QuotesAndSplices
Type a pattern variable name t
in quote pattern as ${given t$giveni: Type[t @ _]}
.
The resulting pattern is the split in splitQuotePattern
.
Type a pattern variable name t
in quote pattern as ${given t$giveni: Type[t @ _]}
.
The resulting pattern is the split in splitQuotePattern
.
- Inherited from
- QuotesAndSplices
Translate ${ t: Expr[T] }
into expression t.splice
while tracking the quotation level in the context
Translate ${ t: Expr[T] }
into expression t.splice
while tracking the quotation level in the context
- Inherited from
- QuotesAndSplices
Translate ${ t: Type[T] }into type
t.splice` while tracking the quotation level in the context
Translate ${ t: Type[T] }into type
t.splice` while tracking the quotation level in the context
- Inherited from
- QuotesAndSplices
The type signature of a ValDef or DefDef
The type signature of a ValDef or DefDef
- Value Params
- mdef
The definition
- paramFn
A wrapping function that produces the type of the defined symbol, given its final return type
- sym
Its symbol
- Inherited from
- Namer
Concrete fields
Inherited fields
The maximal number of suggested imports to make
The maximal number of suggested imports to make
- Inherited from
- ImportSuggestions
A map from method symbols to nested typers. Populated when methods are completed. Emptied when they are typechecked. The nested typer contains new versions of the four maps above including this one, so that trees that are shared between different DefDefs can be independently used as indices. It also contains a scope that contains nested parameters.
A map from method symbols to nested typers. Populated when methods are completed. Emptied when they are typechecked. The nested typer contains new versions of the four maps above including this one, so that trees that are shared between different DefDefs can be independently used as indices. It also contains a scope that contains nested parameters.
- Inherited from
- Namer
The scope of the typer. For nested typers this is a place parameters are entered during completion and where they survive until typechecking. A context with this typer also has this scope.
The scope of the typer. For nested typers this is a place parameters are entered during completion and where they survive until typechecking. A context with this typer also has this scope.
- Inherited from
- Namer
Extensions
Inherited extensions
The best n
references in refs
, according to compare
compare
is a partial order. If there's a tie, we take elements
in the order thy appear in the list.
The best n
references in refs
, according to compare
compare
is a partial order. If there's a tie, we take elements
in the order thy appear in the list.
- Inherited from
- ImportSuggestions
The ref
parts of this list of pairs, discarding subsequent elements that
have the same String part. Elements are sorted by their String parts.
The ref
parts of this list of pairs, discarding subsequent elements that
have the same String part. Elements are sorted by their String parts.
- Inherited from
- ImportSuggestions