CheckCaptures

dotty.tools.dotc.cc.CheckCaptures
See theCheckCaptures companion class
object CheckCaptures

The capture checker

Attributes

Companion
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Type members

Classlikes

case class Env(owner: Symbol, kind: EnvKind, captured: CaptureSet, outer0: Env | Null)

A class describing environments.

A class describing environments.

Value parameters

captured

the caputure set containing all references to tracked free variables outside of boxes

kind

the environment's kind

outer0

the next enclosing environment

owner

the current owner

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
enum EnvKind

Attributes

Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
class Pre extends PreRecheck, SymTransformer

Attributes

Supertypes
class PreRecheck
class Phase
class Object
trait Matchable
class Any
Show all
final class SubstParamsBiMap(from: LambdaType, to: List[Type])(using x$3: Context) extends BiTypeMap

Attributes

Supertypes
trait BiTypeMap
class TypeMap
trait Type => Type
class Object
trait Matchable
class Any
Show all
Self type
final class SubstParamsMap(from: BindingType, to: List[Type])(using x$3: Context) extends ApproximatingTypeMap, IdempotentCaptRefMap

Similar normal substParams, but this is an approximating type map that maps parameters in contravariant capture sets to the empty set.

Similar normal substParams, but this is an approximating type map that maps parameters in contravariant capture sets to the empty set.

Attributes

Supertypes
class TypeMap
trait Type => Type
class Object
trait Matchable
class Any
Show all

Value members

Concrete methods

def checkWellformed(parent: Tree, ann: Tree)(using Context): Unit

Check that a @retains annotation only mentions references that can be tracked. This check is performed at Typer.

Check that a @retains annotation only mentions references that can be tracked. This check is performed at Typer.

Attributes

def checkWellformedPost(tp: Type, pos: SrcPos)(using Context): Unit

If tp is a capturing type, check that all references it mentions have non-empty capture sets. Also: warn about redundant capture annotations. This check is performed after capture sets are computed in phase cc.

If tp is a capturing type, check that all references it mentions have non-empty capture sets. Also: warn about redundant capture annotations. This check is performed after capture sets are computed in phase cc.

Attributes

def warnIfRedundantCaptureSet(ann: Tree, tpt: Tree)(using Context): Unit

Warn if ann, which is the tree of a @retains annotation, defines some elements that are already accounted for by other elements of the same annotation. Note: We need to perform the check on the original annotation rather than its capture set since the conversion to a capture set already eliminates redundant elements.

Warn if ann, which is the tree of a @retains annotation, defines some elements that are already accounted for by other elements of the same annotation. Note: We need to perform the check on the original annotation rather than its capture set since the conversion to a capture set already eliminates redundant elements.

Attributes

Concrete fields

Attachment key for bodies of closures, provided they are values

Attachment key for bodies of closures, provided they are values

Attributes