CaptureSet

dotty.tools.dotc.cc.CaptureSet
See theCaptureSet companion class
object CaptureSet

Attributes

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

Members list

Type members

Classlikes

final class BiMapped extends DerivedVar

A mapping where the type map is required to be a bijection. Parameters as in Mapped.

A mapping where the type map is required to be a bijection. Parameters as in Mapped.

Attributes

Supertypes
class DerivedVar
class Var
class CaptureSet
trait Showable
class Object
trait Matchable
class Any
Show all
opaque object CompareResult

The result of subcapturing comparisons is an opaque type CompareResult.TYPE. This is either OK, indicating success, or another capture set, indicating failure. The failure capture set is the one that did not allow propagaton of elements into it.

The result of subcapturing comparisons is an opaque type CompareResult.TYPE. This is either OK, indicating success, or another capture set, indicating failure. The failure capture set is the one that did not allow propagaton of elements into it.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
class Const extends CaptureSet

The subclass of constant capture sets with given elements elems

The subclass of constant capture sets with given elements elems

Attributes

Supertypes
class CaptureSet
trait Showable
class Object
trait Matchable
class Any
abstract class DerivedVar(initialElems: Refs)(using ctx: Context) extends Var

A variable that is derived from some other variable via a map or filter.

A variable that is derived from some other variable via a map or filter.

Attributes

Supertypes
class Var
class CaptureSet
trait Showable
class Object
trait Matchable
class Any
Show all
Known subtypes
class BiMapped
class Filtered
class Diff
class Mapped
class Diff(source: Var, other: Const)(using x$3: Context) extends Filtered

A variable with elements given at any time as { x <- source.elems | !other.accountsFor(x) }

A variable with elements given at any time as { x <- source.elems | !other.accountsFor(x) }

Attributes

Supertypes
class Filtered
class DerivedVar
class Var
class CaptureSet
trait Showable
class Object
trait Matchable
class Any
Show all
class Filtered extends DerivedVar

A variable with elements given at any time as { x <- source.elems | p(x) }

A variable with elements given at any time as { x <- source.elems | p(x) }

Attributes

Supertypes
class DerivedVar
class Var
class CaptureSet
trait Showable
class Object
trait Matchable
class Any
Show all
Known subtypes
class Diff
object FrozenState extends VarState

A special state that does not allow to record elements or dependent sets. In effect this means that no new elements or dependent sets can be added in this state (since the previous state cannot be recorded in a snapshot)

A special state that does not allow to record elements or dependent sets. In effect this means that no new elements or dependent sets can be added in this state (since the previous state cannot be recorded in a snapshot)

Attributes

Supertypes
class VarState
class Object
trait Matchable
class Any
Self type

A TypeMap with the property that every capture reference in the image of the map is mapped to itself. I.e. for all capture references r1, r2, if M(r1) == r2 then M(r2) == r2.

A TypeMap with the property that every capture reference in the image of the map is mapped to itself. I.e. for all capture references r1, r2, if M(r1) == r2 then M(r2) == r2.

Attributes

Supertypes
class TypeMap
trait Type => Type
class Object
trait Matchable
class Any
Show all
Known subtypes
class AvoidMap
Show all
trait IdentityCaptRefMap extends TypeMap

A TypeMap that is the identity on capture references

A TypeMap that is the identity on capture references

Attributes

Supertypes
class TypeMap
trait Type => Type
class Object
trait Matchable
class Any
Show all
Known subtypes
class Intersected(cs1: CaptureSet, cs2: CaptureSet)(using x$3: Context) extends Var

Attributes

Supertypes
class Var
class CaptureSet
trait Showable
class Object
trait Matchable
class Any
Show all
class Mapped extends DerivedVar

A variable that changes when source changes, where all additional new elements are mapped using ∪ { tm(x) | x <- source.elems }.

A variable that changes when source changes, where all additional new elements are mapped using ∪ { tm(x) | x <- source.elems }.

Value parameters

initial

The initial mappings of source's elements at the point the Mapped set is created.

source

the original set that is mapped

tm

the type map, which is assumed to be idempotent on capture refs (except if ccUnsoundMaps is enabled)

variance

the assumed variance with which types with capturesets of size >= 2 are approximated (i.e. co: full capture set, contra: empty set, nonvariant is not allowed.)

Attributes

Supertypes
class DerivedVar
class Var
class CaptureSet
trait Showable
class Object
trait Matchable
class Any
Show all
class Var(initialElems: Refs) extends CaptureSet

The subclass of captureset variables with given initial elements

The subclass of captureset variables with given initial elements

Attributes

Supertypes
class CaptureSet
trait Showable
class Object
trait Matchable
class Any
Known subtypes
class DerivedVar
class BiMapped
class Filtered
class Diff
class Mapped
class Intersected
Show all
class VarState

A VarState serves as a snapshot mechanism that can undo additions of elements or super sets if an operation fails

A VarState serves as a snapshot mechanism that can undo additions of elements or super sets if an operation fails

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
object FrozenState

Value members

Concrete methods

def apply(elems: CaptureRef*)(using Context): Const
def apply(elems: Refs)(using Context): Const
def extrapolateCaptureRef(r: CaptureRef, tm: TypeMap, variance: Int)(using Context): CaptureSet

Extrapolate tm(r) according to variance. Let r1 be the result of tm(r).

Extrapolate tm(r) according to variance. Let r1 be the result of tm(r).

  • If r1 is a tracked CaptureRef, return {r1}
  • If r1 has an empty capture set, return {}
  • Otherwise,
    • if the variance is covariant, return r1's capture set
    • if the variance is contravariant, return {}
    • Otherwise assertion failure

Attributes

Apply f to each element in xs, and join result sets with ++

Apply f to each element in xs, and join result sets with ++

Attributes

def mapRefs(xs: Refs, tm: TypeMap, variance: Int)(using Context): CaptureSet

Apply extrapolated tm to each element in xs, and join result sets with ++

Apply extrapolated tm to each element in xs, and join result sets with ++

Attributes

def ofInfo(ref: CaptureRef)(using Context): CaptureSet

The capture set of the type underlying a CaptureRef

The capture set of the type underlying a CaptureRef

Attributes

def ofType(tp: Type)(using Context): CaptureSet

Capture set of a type

Capture set of a type

Attributes

def subCapturesRange(arg1: TypeBounds, arg2: Type)(using Context): Boolean

Return true iff

Return true iff

  • arg1 is a TypeBounds >: CL T <: CH T of two capturing types with equal parents.
  • arg2 is a capturing type CA U
  • CH <: CA <: CL In other words, we can unify CL, CH and CA.

Attributes

The universal capture set {cap}

The universal capture set {cap}

Attributes

def varState(using state: VarState): VarState

The current VarState, as passed by the implicit context

The current VarState, as passed by the implicit context

Attributes

def withCaptureSetsExplained[T](op: Context ?=> T)(using ctx: Context): T

Perform op. Under -Ycc-debug, collect and print info about all variables reachable via (_.deps)* from the variables that were shown in op.

Perform op. Under -Ycc-debug, collect and print info about all variables reachable via (_.deps)* from the variables that were shown in op.

Attributes

Concrete fields

val empty: Const

The empty capture set {}

The empty capture set {}

Attributes