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
enum CompareResult extends Showable

Attributes

Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
trait Showable
class Object
trait Matchable
class Any
Show all
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
Known subtypes
object Fluid
abstract class DerivedVar(owner: Symbol, 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 Fluid extends Const

A special capture set that gets added to the types of symbols that were not themselves capture checked, in order to admit arbitrary corresponding capture sets in subcapturing comparisons. Similar to platform types for explicit nulls, this provides more lenient checking against compilation units that were not yet compiled with capture checking on.

A special capture set that gets added to the types of symbols that were not themselves capture checked, in order to admit arbitrary corresponding capture sets in subcapturing comparisons. Similar to platform types for explicit nulls, this provides more lenient checking against compilation units that were not yet compiled with capture checking on.

Attributes

Supertypes
class Const
class CaptureSet
trait Showable
class Object
trait Matchable
class Any
Show all
Self type
Fluid.type
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
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 RefiningVar(directOwner: Symbol)(using x$2: Context) extends Var

Variables that represent refinements of class parameters can have the universal capture set, since they represent only what is the result of the constructor. Test case: Without that tweak, logger.scala would not compile.

Variables that represent refinements of class parameters can have the universal capture set, since they represent only what is the result of the constructor. Test case: Without that tweak, logger.scala would not compile.

Attributes

Supertypes
class Var
class CaptureSet
trait Showable
class Object
trait Matchable
class Any
Show all
class Var(directOwner: Symbol, initialElems: Refs)(using ictx: Context) 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
class RefiningVar
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 CaptureRef

The capture set of the type underlying CaptureRef

Attributes

def ofType(tp: Type, followResult: Boolean)(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