CaptureChecker
Members list
Value members
Concrete methods
Adapt actual
type to expected
type by inserting boxing and unboxing conversions
Adapt actual
type to expected
type by inserting boxing and unboxing conversions
Value parameters
- alwaysConst
-
always make capture set variables constant after adaptation
Attributes
Assert subcapturing cs1 <: cs2
Assert subcapturing cs1 <: cs2
Attributes
If sym
is a class or method nested inside a term, a capture set variable representing the captured variables of the environment associated with sym
.
If sym
is a class or method nested inside a term, a capture set variable representing the captured variables of the environment associated with sym
.
Attributes
Massage actual
and expected
types before checking conformance. Massaging is done by the methods following this one:
Massage actual
and expected
types before checking conformance. Massaging is done by the methods following this one:
- align dependent function types and add outer references in the expected type
- adapt boxing in the actual type If the resulting types are not compatible, try again with an actual type where local capture roots are instantiated to root variables.
Attributes
- Definition Classes
Check subcapturing {elem} <: cs
, report error on failure
Check subcapturing {elem} <: cs
, report error on failure
Attributes
If val or def definition with inferred (result) type is visible in other compilation units, check that the actual inferred type conforms to the expected type where all inferred capture sets are dropped. This ensures that if files compile separately, they will also compile in a joint compilation.
If val or def definition with inferred (result) type is visible in other compilation units, check that the actual inferred type conforms to the expected type where all inferred capture sets are dropped. This ensures that if files compile separately, they will also compile in a joint compilation.
Attributes
Check overrides again, taking capture sets into account. TODO: Can we avoid doing overrides checks twice? We need to do them here since only at this phase CaptureTypes are relevant But maybe we can then elide the check during the RefChecks phase under captureChecking?
Check overrides again, taking capture sets into account. TODO: Can we avoid doing overrides checks twice? We need to do them here since only at this phase CaptureTypes are relevant But maybe we can then elide the check during the RefChecks phase under captureChecking?
Attributes
Check that self types of subclasses conform to self types of super classes. (See comment below how this is achieved). The check assumes that classes without an explicit self type have the universal capture set {cap}
on the self type. If a class without explicit self type is not effectivelyFinal
it is checked that the inferred self type is universal, in order to assure that joint and separate compilation give the same result.
Check that self types of subclasses conform to self types of super classes. (See comment below how this is achieved). The check assumes that classes without an explicit self type have the universal capture set {cap}
on the self type. If a class without explicit self type is not effectivelyFinal
it is checked that the inferred self type is universal, in order to assure that joint and separate compilation give the same result.
Attributes
Check subcapturing cs1 <: cs2
, report error on failure
Check subcapturing cs1 <: cs2
, report error on failure
Attributes
Attributes
- Definition Classes
Check a ValDef or DefDef as an action performed in a completer. Since these checks can appear out of order, we need to firsty create the correct environment for checking the definition.
Check a ValDef or DefDef as an action performed in a completer. Since these checks can appear out of order, we need to firsty create the correct environment for checking the definition.
Attributes
For all nested environments up to limit
or a closed environment perform op
, but skip environmenrts directly enclosing environments of kind ClosureResult.
For all nested environments up to limit
or a closed environment perform op
, but skip environmenrts directly enclosing environments of kind ClosureResult.
Attributes
Include references captured by the called method in the current environment stack
Include references captured by the called method in the current environment stack
Attributes
Handle an application of method sym
with type mt
to arguments of types argTypes
. This means:
Handle an application of method sym
with type mt
to arguments of types argTypes
. This means:
- Instantiate result type with actual arguments
- If call is to a constructor:
- remember types of arguments corresponding to tracked parameters in refinements.
- add capture set of instantiated class to capture set of result type. If all argument types are mutually different trackable capture references, use a BiTypeMap, since that is more precise. Otherwise use a normal idempotent map, which might lose information in the case where the result type contains captureset variables that are further constrained afterwards.
Attributes
- Definition Classes
Should type of tree
be kept in an attachment so that it can be retrieved with knownType
? By default true only is keepAllTypes
hold, but can be overridden.
Should type of tree
be kept in an attachment so that it can be retrieved with knownType
? By default true only is keepAllTypes
hold, but can be overridden.
Attributes
- Definition Classes
Include sym
in the capture sets of all enclosing environments nested in the the environment in which sym
is defined.
Include sym
in the capture sets of all enclosing environments nested in the the environment in which sym
is defined.
Attributes
Make sure (projected) cs
is a subset of the capture sets of all enclosing environments. At each stage, only include references from cs
that are outside the environment's owner
Make sure (projected) cs
is a subset of the capture sets of all enclosing environments. At each stage, only include references from cs
that are outside the environment's owner
Attributes
Perform the following kinds of checks
Perform the following kinds of checks
- Check all explicitly written capturing types for well-formedness using
checkWellFormedPost
. - Check that arguments of TypeApplys and AppliedTypes conform to their bounds.
- Heal ill-formed capture sets of type parameters. See
healTypeParam
.
Attributes
If expected type pt
is boxed and the tree is a function or a reference, don't propagate free variables. Otherwise, if the result type is boxed, simulate an unboxing by adding all references in the boxed capture set to the current environment.
If expected type pt
is boxed and the tree is a function or a reference, don't propagate free variables. Otherwise, if the result type is boxed, simulate an unboxing by adding all references in the boxed capture set to the current environment.
Attributes
- Definition Classes
A specialized implementation of the apply rule.
A specialized implementation of the apply rule.
E |- f: Ra ->Cf Rr^Cr E |- a: Ra^Ca
E |- f a: Rr^C
The implementation picks as C
one of {f, a}
or Cr
, depending on the outcome of a mightSubcapture
test. It picks {f, a}
if this might subcapture Cr and Cr otherwise.
Attributes
- Definition Classes
Class-specific capture set relations:
Class-specific capture set relations:
- The capture set of a class includes the capture sets of its parents.
- The capture set of the self type of a class includes the capture set of the class.
- The capture set of the self type of a class includes the capture set of every class parameter, unless the parameter is marked @constructorOnly.
- If the class extends a pure base class, the capture set of the self type must be empty.
Attributes
- Definition Classes
Attributes
- Definition Classes
Attributes
- Definition Classes
Attributes
- Definition Classes
Finish rechecking a tree node: check rechecked type against expected type and remember rechecked type in a tree attachment if required.
Finish rechecking a tree node: check rechecked type against expected type and remember rechecked type in a tree attachment if required.
Value parameters
- pt
-
the expected type
- tpe
-
the recheched type of
tree
- tree
-
the rechecked tree
Attributes
- Definition Classes
Attributes
- Definition Classes
A specialized implementation of the selection rule.
A specialized implementation of the selection rule.
E |- f: f{ m: Cr R }^Cf
E |- f.m: R^C
The implementation picks as C
one of {f}
or Cr
, depending on the outcome of a mightSubcapture
test. It picks {f}
if this might subcapture Cr and Cr otherwise.
Attributes
- Definition Classes
Attributes
- Definition Classes
Attributes
- Definition Classes
If type is of the form T @requiresCapability(x)
, mark x
as free in the current environment. This is used to require the correct CanThrow
capability when encountering a throw
.
If type is of the form T @requiresCapability(x)
, mark x
as free in the current environment. This is used to require the correct CanThrow
capability when encountering a throw
.
Attributes
- Definition Classes
Inherited methods
Check that widened types of tpe
and pt
are compatible.
Attributes
- Inherited from:
- Rechecker
Attributes
- Inherited from:
- Rechecker
Attributes
- Inherited from:
- Rechecker
Attributes
- Inherited from:
- Rechecker
Attributes
- Inherited from:
- Rechecker
Attributes
- Inherited from:
- Rechecker
Attributes
- Inherited from:
- Rechecker
Attributes
- Inherited from:
- Rechecker
Attributes
- Inherited from:
- Rechecker
Attributes
- Inherited from:
- Rechecker
Attributes
- Inherited from:
- Rechecker
Attributes
- Inherited from:
- Rechecker
Recheck tree without adapting it, returning its new type.
Recheck tree without adapting it, returning its new type.
Value parameters
- pt
-
the expected result type
- tree
-
the original tree
Attributes
- Inherited from:
- Rechecker
Attributes
- Inherited from:
- Rechecker
Attributes
- Inherited from:
- Rechecker
Attributes
- Inherited from:
- Rechecker
Reset all references in prevSelDenots
to the denotations they had before this phase.
Reset all references in prevSelDenots
to the denotations they had before this phase.
Attributes
- Inherited from:
- Rechecker
Typing and previous transforms sometimes leaves skolem types in prefixes of NamedTypes in expected
that do not match the actual
Type. -Ycheck does not complain (need to find out why), but a full recheck does. We compensate by de-skolemizing everywhere in expected
except when variance is negative.
Typing and previous transforms sometimes leaves skolem types in prefixes of NamedTypes in expected
that do not match the actual
Type. -Ycheck does not complain (need to find out why), but a full recheck does. We compensate by de-skolemizing everywhere in expected
except when variance is negative.
Attributes
- Returns
-
If
tp
contains SkolemTypes in covariant or invariant positions, the type where these SkolemTypes are mapped to their underlying type. Otherwise,tp
itself - Inherited from:
- Rechecker