Attributes
- Companion:
- object
- Graph
- Supertypes
- Known subtypes
- Self type
Members list
Type members
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.
Attributes
- Graph
- Supertypes
Subclass of Application for applicability tests with value argument types.
Subclass of Application for applicability tests with value argument types.
Attributes
- Graph
- Supertypes
Attributes
- Arg
the type of arguments, could be tpd.Tree, untpd.Tree, or Type
- 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
- Graph
- Supertypes
- Known subtypes
- class TestApplication[Arg]class ApplicableToTreesclass ApplicableToTypesclass TypedApply[T]class ApplyToTypedclass ApplyToUntyped
Subclass of Application for type checking an Apply node with typed arguments.
Subclass of Application for type checking an Apply node with typed arguments.
Attributes
- Graph
- Supertypes
Subclass of Application for type checking an Apply node with untyped arguments.
Subclass of Application for type checking an Apply node with untyped arguments.
Attributes
- Graph
- Supertypes
The degree to which an argument has to match a formal parameter
The degree to which an argument has to match a formal parameter
Attributes
- Graph
- Supertypes
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.
Attributes
- Graph
- Supertypes
- Known subtypes
- class ApplicableToTreesclass ApplicableToTypes
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.
Attributes
- Graph
- Supertypes
- Known subtypes
- class ApplyToTypedclass ApplyToUntyped
Value members
Concrete 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
Attributes
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.
Attributes
Compare two alternatives of an overloaded call or an implicit search.
Compare two alternatives of an overloaded call or an implicit search.
Attributes
- 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.
Compare owner inheritance level.
Compare owner inheritance level.
Attributes
- 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.
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.
Attributes
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 harmonization will be compared again with the expected type.
Test cases where this matters are in neg/harmomize.scala and run/weak-conformance.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 harmonization will be compared again with the expected type.
Test cases where this matters are in neg/harmomize.scala and run/weak-conformance.scala.
Note: this assumes that the internal typing of the arguments using op
does
not leave any constraints, so the only info that is reset is the relationship
between the argument's types and the expected type. I am not sure this will
always be the case. If that property does not hold, we risk forgetting constraints
which could lead to unsoundness.
Attributes
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.
Attributes
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
?
Attributes
Is given method reference applicable to argument trees args
?
Is given method reference applicable to argument trees args
?
Attributes
- resultType
The expected result type of the application
Is given method reference applicable to argument types args
?
Is given method reference applicable to argument types args
?
Attributes
- resultType
The expected result type of the application
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
?
Attributes
- resultType
The expected result type of the application
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
?
Attributes
- resultType
The expected result type of the application
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?
Attributes
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.
Attributes
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.
Attributes
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.
Attributes
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.
Attributes
Drop any leading implicit parameter sections
Drop any leading implicit parameter sections
Attributes
Drop any leading type or implicit parameter sections
Drop any leading type or implicit parameter sections
Attributes
The largest suffix of paramss
that has the same first parameter name as t
,
plus the number of term parameters in paramss
that come before that suffix.
The largest suffix of paramss
that has the same first parameter name as t
,
plus the number of term parameters in paramss
that come before that suffix.
Attributes
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 proceeding implicits). No implicit search is tried for implicits following the receiver or for parameters of the def (D, E).
Attributes
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.
Attributes
A typed unapply hook, can be overridden by re any-typers between frontend and pattern matcher.
A typed unapply hook, can be overridden by re any-typers between frontend and pattern matcher.
Attributes
If tree
is a complete application of a compiler-generated apply
or copy
method of an enum case, widen its type to the underlying
type by means of a type ascription, as long as the widened type is
still compatible with the expected type.
The underlying type is the intersection of all class parents of the
original type.
If tree
is a complete application of a compiler-generated apply
or copy
method of an enum case, widen its type to the underlying
type by means of a type ascription, as long as the widened type is
still compatible with the expected type.
The underlying type is the intersection of all class parents of the
original type.
Attributes
Inherited methods
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.
Attributes
- 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.
Attributes
- Inherited from:
- Compatibility
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.
Attributes
- Inherited from:
- Compatibility
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.
Attributes
- Inherited from:
- Compatibility
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.
Attributes
- Inherited from:
- Compatibility
Is there an implicit conversion from tp
to pt
?