GadtConstraint

dotty.tools.dotc.core.GadtConstraint
See theGadtConstraint companion object
sealed trait GadtConstraint(var myConstraint: Constraint, var mapping: SimpleIdentityMap[Symbol, TypeVar], var reverseMapping: SimpleIdentityMap[TypeParamRef, Symbol], var wasConstrained: Boolean) extends Showable

Represents GADT constraints currently in scope

Attributes

Companion:
object
Graph
Supertypes
trait Showable
class Object
trait Matchable
class Any
Self type

Members list

Concise view

Value members

Concrete methods

def addBound(sym: Symbol, bound: Type, isUpper: Boolean)(using Context): Boolean

Further constrain a symbol already present in the constraint.

Further constrain a symbol already present in the constraint.

Attributes

Add symbols to constraint, correctly handling inter-dependencies.

Add symbols to constraint, correctly handling inter-dependencies.

Attributes

See also:
def addToConstraint(params: List[Symbol])(using Context): Boolean
def bounds(sym: Symbol)(using Context): TypeBounds | Null

Immediate bounds of sym. Does not contain lower/upper symbols (see fullBounds).

Immediate bounds of sym. Does not contain lower/upper symbols (see fullBounds).

Attributes

override def constr: noPrinter.type

Attributes

Definition Classes
def contains(sym: Symbol)(using Context): Boolean

Is the symbol registered in the constraint?

Is the symbol registered in the constraint?

Attributes

Note:

this is true even if the symbol is constrained to be equal to another type, unlike Constraint.contains.

Provides more information than toText, by showing the underlying Constraint details.

Provides more information than toText, by showing the underlying Constraint details.

Attributes

def fullBounds(sym: Symbol)(using Context): TypeBounds | Null

Full bounds of sym, including TypeRefs to other lower/upper symbols.

Full bounds of sym, including TypeRefs to other lower/upper symbols.

Attributes

Note:

this performs subtype checks between ordered symbols. Using this in isSubType can lead to infinite recursion. Consider bounds instead.

override def fullLowerBound(param: TypeParamRef)(using Context): Type

Attributes

Definition Classes
override def fullUpperBound(param: TypeParamRef)(using Context): Type

Attributes

Definition Classes
def isLess(sym1: Symbol, sym2: Symbol)(using Context): Boolean

Is sym1 ordered to be less than sym2?

Is sym1 ordered to be less than sym2?

Attributes

GADT constraint narrows bounds of at least one variable

GADT constraint narrows bounds of at least one variable

Attributes

override def nonParamBounds(param: TypeParamRef)(using Context): TypeBounds

Attributes

Definition Classes

Restore the state from other GadtConstraint, probably copied using fresh

Restore the state from other GadtConstraint, probably copied using fresh

Attributes

Exposes ConstraintHandling.subsumes

Exposes ConstraintHandling.subsumes

Attributes

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 methods

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