Diff

dotty.tools.dotc.cc.CaptureSet.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) }

Attributes

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

Members list

Value members

Inherited methods

def **(that: CaptureSet)(using Context): CaptureSet

The largest capture set (via <:<) that is a subset of both this and that

The largest capture set (via <:<) that is a subset of both this and that

Attributes

Inherited from:
CaptureSet
def +(ref: CaptureRef)(using Context): CaptureSet

The smallest superset (via <:<) of this capture set that also contains ref.

The smallest superset (via <:<) of this capture set that also contains ref.

Attributes

Inherited from:
CaptureSet
def ++(that: CaptureSet)(using Context): CaptureSet

The smallest capture set (via <:<) that is a superset of both this and that

The smallest capture set (via <:<) that is a superset of both this and that

Attributes

Inherited from:
CaptureSet
def -(ref: CaptureRef)(using Context): CaptureSet

The largest subset (via <:<) of this capture set that does not account for ref

The largest subset (via <:<) of this capture set that does not account for ref

Attributes

Inherited from:
CaptureSet
def --(that: Const)(using Context): CaptureSet

The largest subset (via <:<) of this capture set that does not account for any of the elements in the constant capture set that

The largest subset (via <:<) of this capture set that does not account for any of the elements in the constant capture set that

Attributes

Inherited from:
CaptureSet
def =:=(that: CaptureSet)(using Context): Boolean

Two capture sets are considered =:= equal if they mutually subcapture each other in a frozen state.

Two capture sets are considered =:= equal if they mutually subcapture each other in a frozen state.

Attributes

Inherited from:
CaptureSet

{x} <:< this where <:< is subcapturing, but treating all variables as frozen.

{x} <:< this where <:< is subcapturing, but treating all variables as frozen.

Attributes

Inherited from:
CaptureSet

If this is a variable, add cs as a dependent set

If this is a variable, add cs as a dependent set

Attributes

Inherited from:
Var

Add a specific element, assuming it is not already accounted for, and omitting any mapping or filtering, without possibility to backtrack to the underlying capture set.

Add a specific element, assuming it is not already accounted for, and omitting any mapping or filtering, without possibility to backtrack to the underlying capture set.

Attributes

Inherited from:
Var
def asConst: Const

Convert to Const. @pre: isConst

Convert to Const. @pre: isConst

Attributes

Inherited from:
CaptureSet
def asVar: Var

Cast to variable. @pre: !isConst

Cast to variable. @pre: !isConst

Attributes

Inherited from:
CaptureSet
override def computeApprox(origin: CaptureSet)(using Context): CaptureSet

The intersection of all upper approximations of dependent sets

The intersection of all upper approximations of dependent sets

Attributes

Definition Classes
Inherited from:
Filtered
override def disallowRootCapability(handler: () => Context ?=> Unit)(using Context): Var.this.type

Invoke handler if this set has (or later aquires) the root capability cap

Invoke handler if this set has (or later aquires) the root capability cap

Attributes

Definition Classes
Inherited from:
Var
override def ensureWellformed(handler: CaptureRef => Context ?=> Unit)(using Context): Var.this.type

Invoke handler on the elements to ensure wellformedness of the capture set. The handler might add additional elements to the capture set.

Invoke handler on the elements to ensure wellformedness of the capture set. The handler might add additional elements to the capture set.

Attributes

Definition Classes
Inherited from:
Var
def fallbackToText(printer: Printer): Text

A fallback text representation, if the pattern matching in Printers does not have a case for this showable element

A fallback text representation, if the pattern matching in Printers does not have a case for this showable element

Attributes

Inherited from:
Showable

The largest subset (via <:<) of this capture set that only contains elements for which p is true.

The largest subset (via <:<) of this capture set that only contains elements for which p is true.

Attributes

Inherited from:
CaptureSet

Is this capture set always empty? For unsolved capture veriables, returns always false.

Is this capture set always empty? For unsolved capture veriables, returns always false.

Attributes

Inherited from:
Var

Is this capture set constant (i.e. not an unsolved capture variable)? Solved capture variables count as constant.

Is this capture set constant (i.e. not an unsolved capture variable)? Solved capture variables count as constant.

Attributes

Inherited from:
Var
final def isNotEmpty: Boolean

Is this capture set definitely non-empty?

Is this capture set definitely non-empty?

Attributes

Inherited from:
CaptureSet
final def isUniversal(using Context): Boolean

Does this capture set contain the root reference cap as element?

Does this capture set contain the root reference cap as element?

Attributes

Inherited from:
CaptureSet
def map(tm: TypeMap)(using Context): CaptureSet

Capture set obtained by applying tm to all elements of the current capture set and joining the results. If the current capture set is a variable, the same transformation is applied to all future additions of new elements.

Capture set obtained by applying tm to all elements of the current capture set and joining the results. If the current capture set is a variable, the same transformation is applied to all future additions of new elements.

Note: We have a problem how we handle the situation where we have a mapped set

cs2 = tm(cs1)

and then the propagation solver adds a new element x to cs2. What do we know in this case about cs1? We can answer this question in a sound way only if tm is a bijection on capture references or it is idempotent on capture references. (see definition in IdempotentCapRefMap). If tm is a bijection we know that tm^-1(x) must be in cs1. If tm is idempotent one possible solution is that x is in cs1, which is what we assume in this case. That strategy is sound but not complete.

If tm is some other map, we don't know how to handle this case. For now, we simply refuse to handle other maps. If they do need to be handled, OtherMapped provides some approximation to a solution, but it is neither sound nor complete.

Attributes

Inherited from:
CaptureSet
def markSolved()(using Context): Unit

Mark set as solved and propagate this info to all dependent sets

Mark set as solved and propagate this info to all dependent sets

Attributes

Inherited from:
Var

A more optimistic version of accountsFor, which does not take variable supersets of the x reference into account. A set might account for x if it accounts for x in a state where we assume all supersets of x have just the elements known at this point. On the other hand if x's capture set has no known elements, a set cs might account for x only if it subsumes x or it contains the root capability cap.

A more optimistic version of accountsFor, which does not take variable supersets of the x reference into account. A set might account for x if it accounts for x in a state where we assume all supersets of x have just the elements known at this point. On the other hand if x's capture set has no known elements, a set cs might account for x only if it subsumes x or it contains the root capability cap.

Attributes

Inherited from:
CaptureSet

A more optimistic version of subCaptures used to choose one of two typing rules for selections and applications. cs1 mightSubcapture cs2 if cs2 might account for every element currently known to be in cs1.

A more optimistic version of subCaptures used to choose one of two typing rules for selections and applications. cs1 mightSubcapture cs2 if cs2 might account for every element currently known to be in cs1.

Attributes

Inherited from:
CaptureSet
override def optionalInfo(using Context): String

Adds variables to the ShownVars context property if that exists, which establishes a record of all variables printed in an error message. Returns variable ids under -Ycc-debug, and owner/nesting level info under -Yprint-level.

Adds variables to the ShownVars context property if that exists, which establishes a record of all variables printed in an error message. Returns variable ids under -Ycc-debug, and owner/nesting level info under -Yprint-level.

Attributes

Definition Classes
Inherited from:
Var
override def propagateSolved()(using Context): Unit

Assuming set this set dependds on was just solved to be constant, propagate this info to this set. This might result in the set being solved to be constant itself.

Assuming set this set dependds on was just solved to be constant, propagate this info to this set. This might result in the set being solved to be constant itself.

Attributes

Definition Classes
Inherited from:
DerivedVar
def resetDeps()(using state: VarState): Unit

Reset dependent sets to what was recorded in state

Reset dependent sets to what was recorded in state

Attributes

Inherited from:
Var
def resetElems()(using state: VarState): Unit

Reset elements to what was recorded in state

Reset elements to what was recorded in state

Attributes

Inherited from:
Var
def show(using Context): String

The string representation of this showable element.

The string representation of this showable element.

Attributes

Inherited from:
Showable
def showIndented(margin: Int)(using Context): String

The string representation with each line after the first one indented by the given given margin (in spaces).

The string representation with each line after the first one indented by the given given margin (in spaces).

Attributes

Inherited from:
Showable
def showSummary(depth: Int)(using Context): String

The summarized string representation of this showable element. Recursion depth is limited to some smallish value. Default is Config.summarizeDepth.

The summarized string representation of this showable element. Recursion depth is limited to some smallish value. Default is Config.summarizeDepth.

Attributes

Inherited from:
Showable
def solve()(using Context): Unit

Widen the variable's elements to its upper approximation and mark it as constant from now on. This is used for contra-variant type variables in the results of defs and vals.

Widen the variable's elements to its upper approximation and mark it as constant from now on. This is used for contra-variant type variables in the results of defs and vals.

Attributes

Inherited from:
Var
final def subCaptures(that: CaptureSet, frozen: Boolean)(using Context): CompareResult

The subcapturing test.

The subcapturing test.

Value parameters

frozen

if true, no new variables or dependent sets are allowed to be added when making this test. An attempt to add either will result in failure.

Attributes

Inherited from:
CaptureSet

A mapping resulting from substituting parameters of a BindingType to a list of types

A mapping resulting from substituting parameters of a BindingType to a list of types

Attributes

Inherited from:
CaptureSet

A regular @retains or @retainsByName annotation with the elements of this set as arguments.

A regular @retains or @retainsByName annotation with the elements of this set as arguments.

Attributes

Inherited from:
CaptureSet
override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Filtered -> Var -> Any
Inherited from:
Filtered
override def toText(printer: Printer): Text

The text representation of this showable element. This normally dispatches to a pattern matching method in Printers.

The text representation of this showable element. This normally dispatches to a pattern matching method in Printers.

Attributes

Definition Classes
Inherited from:
CaptureSet
override def tryInclude(elem: CaptureRef, origin: CaptureSet)(using Context, VarState): CompareResult

Try to include an element in this capture set.

Try to include an element in this capture set.

Value parameters

elem

The element to be added

origin

The set that originated the request, or empty if the request came from outside. If the set already accounts for the element, return OK. Otherwise, try to add a new element to the set. This is OK if

  • the set is a variable, and
  • the element is not at a deeper nesting level than the set, and
  • the element can also be added (in mapped/filtered form) to all dependent sets. If the origin is the same as the source of the set variable, the element might be filtered or mapped according to the class of the variable. Otherwise, the element might have to be back-propagated to the source of the variable. If the element itself cannot be added to the set for some reason, and the element is not the root capability, try instead to include its underlying capture set.

Attributes

Definition Classes
Inherited from:
Filtered
final def upperApprox(origin: CaptureSet)(using Context): CaptureSet

Roughly: the intersection of all constant known supersets of this set. The aim is to find an as-good-as-possible constant set that is a superset of this set. The universal set {cap} is a sound fallback.

Roughly: the intersection of all constant known supersets of this set. The aim is to find an as-good-as-possible constant set that is a superset of this set. The universal set {cap} is a sound fallback.

Attributes

Inherited from:
Var
def withDescription(description: String): Var.this.type

This capture set with a description that tells where it comes from

This capture set with a description that tells where it comes from

Attributes

Inherited from:
Var

Inherited fields

var deps: Deps

The sets currently known to be dependent sets (i.e. new additions to this set are propagated to these dependent sets.)

The sets currently known to be dependent sets (i.e. new additions to this set are propagated to these dependent sets.)

Attributes

Inherited from:
Var

The provided description (set via withDescription) for this capture set or else ""

The provided description (set via withDescription) for this capture set or else ""

Attributes

Inherited from:
Var
var elems: Refs

The elements currently known to be in the set

The elements currently known to be in the set

Attributes

Inherited from:
Var
val id: Int

A unique identification number for diagnostics

A unique identification number for diagnostics

Attributes

Inherited from:
Var
override val levelLimit: Symbol

An optional level limit, or NoSymbol if none exists. All elements of the set must be in scopes visible from the level limit.

An optional level limit, or NoSymbol if none exists. All elements of the set must be in scopes visible from the level limit.

Attributes

Inherited from:
Var

A handler to be invoked when new elems are added to this set

A handler to be invoked when new elems are added to this set

Attributes

Inherited from:
Var
var rootAddedHandler: () => Context ?=> Unit

A handler to be invoked if the root reference cap is added to this set

A handler to be invoked if the root reference cap is added to this set

Attributes

Inherited from:
Var
val stack: Array[StackTraceElement | Null] | Null

Attributes

Inherited from:
DerivedVar