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
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 using the methods below before checking conformance
Massage actual
and expected
types using the methods below before checking conformance
Attributes
- Definition Classes
Check subcapturing {elem} <: cs
, report error on failure
Check subcapturing {elem} <: cs
, report error on failure
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 {*}
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 {*}
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
For all nested environments up to limit
perform op
For all nested environments up to limit
perform op
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.
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 externally visible
val
s ordef
s have empty capture sets. If not, suggest an explicit type. This is so that separate compilation (where external symbols have empty capture sets) gives the same results as joint compilation.
Attributes
If expected type pt
is boxed, 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, 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: Cf (Ra -> Cr Rr) E |- a: Ca Ra
E |- f a: C Rr
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
Additionally to normal processing, update types of closures if the expected type is a function with only pure parameters. In that case, make the anonymous function also have the same parameters as the prototype. TODO: Develop a clearer rationale for this. TODO: Can we generalize this to arbitrary parameters? Currently some tests fail if we do this. (e.g. neg.../stackAlloc.scala, others)
Additionally to normal processing, update types of closures if the expected type is a function with only pure parameters. In that case, make the anonymous function also have the same parameters as the prototype. TODO: Develop a clearer rationale for this. TODO: Can we generalize this to arbitrary parameters? Currently some tests fail if we do this. (e.g. neg.../stackAlloc.scala, others)
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.
Attributes
- Definition Classes
Attributes
- Definition Classes
Attributes
- Definition Classes
If tree
is a reference or an application where the result type refers
to an enclosing class or method parameter of the reference, check that the result type
does not capture the universal capability. This is justified since the
result type would have to be implicitly unboxed.
TODO: Can we find a cleaner way to achieve this? Logically, this should be part
of simulated boxing and unboxing.
If tree
is a reference or an application where the result type refers
to an enclosing class or method parameter of the reference, check that the result type
does not capture the universal capability. This is justified since the
result type would have to be implicitly unboxed.
TODO: Can we find a cleaner way to achieve this? Logically, this should be part
of simulated boxing and unboxing.
Attributes
- Definition Classes
Attributes
- Definition Classes
A specialized implementation of the selection rule.
A specialized implementation of the selection rule.
E |- f: Cf f { m: Cr R }
E |- f.m: C R
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
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
Recheck tree without adapting it, returning its new type.
Recheck tree without adapting it, returning its new type.
Attributes
- pt
the expected result type
- tree
the original tree
- Inherited from:
- Rechecker
Attributes
- Inherited from:
- Rechecker
Attributes
- Inherited from:
- Rechecker
Attributes
- Inherited from:
- Rechecker
Attributes
- Inherited from:
- Rechecker