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

Members list

Concise view

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

Graph
Supertypes
class Var
trait Showable
class Object
trait Matchable
class Any
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

Graph
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

Graph
Supertypes
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

Graph
Supertypes
class Var
trait Showable
class Object
trait Matchable
class Any
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

Graph
Supertypes
class Filtered
class Var
trait Showable
class Object
trait Matchable
class Any
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

Graph
Supertypes
class Var
trait Showable
class Object
trait Matchable
class Any
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

Graph
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

Graph
Supertypes
class TypeMap
trait Type => Type
class Object
trait Matchable
class Any
Known subtypes

A TypeMap that is the identity on capture references

A TypeMap that is the identity on capture references

Attributes

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

Attributes

Graph
Supertypes
class Var
trait Showable
class Object
trait Matchable
class Any
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 }.

Attributes

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.)

Graph
Supertypes
class Var
trait Showable
class Object
trait Matchable
class Any
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

Graph
Supertypes
trait Showable
class Object
trait Matchable
class Any
Known subtypes
class BiMapped
class Filtered
class Diff
class Mapped
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

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object FrozenState.type

Value members

Concrete methods

def apply(elems: CaptureRef*)(using Context): Const
def apply(elems: Refs)(using Context): Const

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

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 {*}

The universal capture set {*}

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

The empty capture set {}

The empty capture set {}

Attributes