OrderingConstraint

class OrderingConstraint(boundsMap: ParamBounds, lowerMap: ParamOrdering, upperMap: ParamOrdering) extends Constraint

Constraint over undetermined type parameters that keeps separate maps to reflect parameter orderings.

Value parameters:
boundsMap

a map from TypeLambda to arrays. Each array contains twice the number of entries as there a type parameters in the TypeLambda. The first half of the array contains the type bounds that constrain the lambda's type parameters. The second half might contain type variables that track the corresponding parameters, or is left empty (filled with nulls). An instantiated type parameter is represented by having its instance type in the corresponding array entry. The dual use of arrays for poly params and typevars is to save space and hopefully gain some speed.

lowerMap

a map from TypeLambdas to arrays. Each array entry corresponds to a parameter P of the type lambda; it contains all constrained parameters Q that are known to be smaller than P, i.e. Q <: P.

upperMap

a map from TypeLambdas to arrays. Each array entry corresponds to a parameter P of the type lambda; it contains all constrained parameters Q that are known to be greater than P, i.e. P <: Q.

Companion:
object
trait Showable
class Object
trait Matchable
class Any

Type members

Value members

Concrete methods

def add(poly: TypeLambda, tvars: List[TypeVar])(using Context): This
def addLess(param1: TypeParamRef, param2: TypeParamRef, direction: UnificationDirection)(using Context): This
override def checkClosed()(using Context): Unit
Definition Classes
def entry(param: TypeParamRef): Type

The boundsMap entry corresponding to param

The boundsMap entry corresponding to param

def instType(tvar: TypeVar): Type
def isLess(param1: TypeParamRef, param2: TypeParamRef): Boolean
def occursAtToplevel(param: TypeParamRef, inst: Type)(using Context): Boolean
def order(current: This, param1: TypeParamRef, param2: TypeParamRef, direction: UnificationDirection)(using Context): This

Add the fact param1 <: param2 to the constraint current and propagate <:< relationships between parameters ("edges") but not bounds.

Add the fact param1 <: param2 to the constraint current and propagate <:< relationships between parameters ("edges") but not bounds.

def remove(pt: TypeLambda)(using Context): This

A new constraint which is derived from this constraint by removing the type parameter param from the domain and replacing all top-level occurrences of the parameter elsewhere in the constraint by type tp.

A new constraint which is derived from this constraint by removing the type parameter param from the domain and replacing all top-level occurrences of the parameter elsewhere in the constraint by type tp.

override def toString: String
Definition Classes
Any
override def toText(printer: Printer): Text
Definition Classes

The uninstantiated typevars of this constraint

The uninstantiated typevars of this constraint

def updateEntry(param: TypeParamRef, tp: Type)(using Context): This

The public version of updateEntry. Guarantees that there are no cycles

The public version of updateEntry. Guarantees that there are no cycles

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

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

The string representation of this showable element.

The string representation of this showable element.

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

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.

Inherited from:
Showable