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

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Fail
class LevelError
enum CompareResult extends Showable

Attributes

Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
trait Showable
class Object
trait Matchable
class Any
Show all
Known subtypes
class Fail
class LevelError
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 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
case class EmptyWithProvenance(ref: CaptureRef, mapped: Type) extends Const

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Const
class CaptureSet
trait Showable
class Object
trait Matchable
class Any
Show all
case class ExistentialSubsumesFailure(ex: Result, other: CaptureRef) extends ErrorNote

A value of this class is produced and added as a note to ccState when a subsumes check decides that an existential variable ex cannot be instantiated to the other capability other.

A value of this class is produced and added as a note to ccState when a subsumes check decides that an existential variable ex cannot be instantiated to the other capability other.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait ErrorNote
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
class HiddenSet(initialOwner: Symbol)(using ictx: Context) extends Var

A capture set variable used to record the references hidden by a Fresh instance, The elems and deps members are repurposed as follows: elems: Set of hidden references deps : Set of hidden sets for which the Fresh instance owning this set is a hidden element. Hidden sets may become aliases of other hidden sets, which means that reads and writes of elems go to the alias. If H is an alias of R.hidden for some Fresh instance R then: H.elems == {R} H.deps = {R.hidden} This encoding was chosen because it relies only on the elems and deps fields which are already subject through snapshotting and rollbacks in VarState. It's advantageous if we don't need to deal with other pieces of state there.

A capture set variable used to record the references hidden by a Fresh instance, The elems and deps members are repurposed as follows: elems: Set of hidden references deps : Set of hidden sets for which the Fresh instance owning this set is a hidden element. Hidden sets may become aliases of other hidden sets, which means that reads and writes of elems go to the alias. If H is an alias of R.hidden for some Fresh instance R then: H.elems == {R} H.deps = {R.hidden} This encoding was chosen because it relies only on the elems and deps fields which are already subject through snapshotting and rollbacks in VarState. It's advantageous if we don't need to deal with other pieces of state there.

Attributes

Supertypes
class Var
class CaptureSet
trait Showable
class Object
trait Matchable
class Any
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 Intersection(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 RefiningVar(owner: 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 Union(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 Var(initialOwner: Symbol, initialElems: Refs, val level: Level, underBox: Boolean)(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 HiddenSet
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

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Closed
class Separating
object HardSeparate
object Separate
class Unrecorded
object Unrecorded
Show all
object VarState

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
VarState.type

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

def fresh(owner: Symbol)(using Context): CaptureSet

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

Value parameters

followResult

If true, also include capture sets of function results. This mode is currently not used. It could be interesting when we change the system so that the capture set of a function is the union of the capture sets if its span. In this case we should use followResult = true in the call in ofInfo above.

Attributes

def ofTypeDeeply(tp: Type, includeTypevars: Boolean)(using Context): CaptureSet

The deep capture set of a type is the union of all covariant occurrences of capture sets. Nested existential sets are approximated with cap.

The deep capture set of a type is the union of all covariant occurrences of capture sets. Nested existential sets are approximated with cap.

Attributes

def shared(using Context): CaptureSet

The shared capture set {cap.rd}

The shared capture set {cap.rd}

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

The same as CaptureSet.universal but generated implicitly for references of Capability subtypes

The same as CaptureSet.universal but generated implicitly for references of Capability subtypes

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