dotty.tools.dotc.core

OrderingConstraint

Related Docs: object OrderingConstraint | package core

class OrderingConstraint extends Constraint

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

Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. OrderingConstraint
  2. Constraint
  3. Showable
  4. AnyRef
  5. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new OrderingConstraint(boundsMap: ParamBounds, lowerMap: ParamOrdering, upperMap: ParamOrdering)

    boundsMap

    a map from PolyType to arrays. Each array contains twice the number of entries as there a type parameters in the PolyType. The first half of the array contains the type bounds that constrain the polytype'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 PolyTypes to arrays. Each array entry corresponds to a parameter P of the polytype; it contains all constrained parameters Q that are known to be smaller than P, i.e. Q <: P.

    upperMap

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

Type Members

  1. type This = OrderingConstraint

    Definition Classes
    OrderingConstraintConstraint

Value Members

  1. final def !=(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Definition Classes
    AnyRef → Any
  3. def &(other: Constraint)(implicit ctx: Context): OrderingConstraint

    The weakest constraint that subsumes both this constraint and other

    The weakest constraint that subsumes both this constraint and other

    Definition Classes
    OrderingConstraintConstraint
  4. final def ==(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  5. def add(poly: PolyType, tvars: List[TypeVar])(implicit ctx: Context): This

    A new constraint which is derived from this constraint by adding entries for all type parameters of poly.

    A new constraint which is derived from this constraint by adding entries for all type parameters of poly.

    tvars

    A list of type variables associated with the params, or Nil if the constraint will just be checked for satisfiability but will solved to give instances of type variables.

    Definition Classes
    OrderingConstraintConstraint
  6. def addLess(param1: PolyParam, param2: PolyParam)(implicit ctx: Context): This

    A constraint that includes the relationship p1 <: p2.

    A constraint that includes the relationship p1 <: p2. <: relationships between parameters ("edges") are propagated, but non-parameter bounds are left alone.

    Definition Classes
    OrderingConstraintConstraint
  7. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  8. def checkClosed()(implicit ctx: Context): Unit

    Check that constraint only refers to PolyParams bound by itself

    Check that constraint only refers to PolyParams bound by itself

    Definition Classes
    OrderingConstraintConstraint
  9. def checkNonCyclic()(implicit ctx: Context): Unit

    Check that no constrained parameter contains itself as a bound

    Check that no constrained parameter contains itself as a bound

    Definition Classes
    OrderingConstraintConstraint
  10. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  11. def contains(tvar: TypeVar): Boolean

    Does this constraint contain the type variable tvar and is it uninstantiated?

    Does this constraint contain the type variable tvar and is it uninstantiated?

    Definition Classes
    OrderingConstraintConstraint
  12. def contains(param: PolyParam): Boolean

    Does the constraint's domain contain the type parameter param?

    Does the constraint's domain contain the type parameter param?

    Definition Classes
    OrderingConstraintConstraint
  13. def contains(pt: PolyType): Boolean

    Does the constraint's domain contain the type parameters of pt?

    Does the constraint's domain contain the type parameters of pt?

    Definition Classes
    OrderingConstraintConstraint
  14. def dependentParams(tp: Type, isUpper: Boolean): List[PolyParam]

    The list of parameters P such that, for a fresh type parameter Q:

    The list of parameters P such that, for a fresh type parameter Q:

    Q <: tp implies Q <: P and isUpper = true, or tp <: Q implies P <: Q and isUpper = false

  15. def domainParams: List[PolyParam]

    The polytype parameters constrained by this constraint

    The polytype parameters constrained by this constraint

    Definition Classes
    OrderingConstraintConstraint
  16. def domainPolys: List[PolyType]

    The polytypes constrained by this constraint

    The polytypes constrained by this constraint

    Definition Classes
    OrderingConstraintConstraint
  17. def entry(param: PolyParam): Type

    The boundsMap entry corresponding to param

    The boundsMap entry corresponding to param

    Definition Classes
    OrderingConstraintConstraint
  18. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  19. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  20. def exclusiveLower(param: PolyParam, butNot: PolyParam): List[PolyParam]

    lower(param) \ lower(butNot)

    lower(param) \ lower(butNot)

    Definition Classes
    OrderingConstraintConstraint
  21. def exclusiveUpper(param: PolyParam, butNot: PolyParam): List[PolyParam]

    upper(param) \ upper(butNot)

    upper(param) \ upper(butNot)

    Definition Classes
    OrderingConstraintConstraint
  22. 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

    Definition Classes
    Showable
  23. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  24. def forallParams(p: (PolyParam) ⇒ Boolean): Boolean

    Check whether predicate holds for all parameters in constraint

    Check whether predicate holds for all parameters in constraint

    Definition Classes
    OrderingConstraintConstraint
  25. def foreachParam(p: (PolyType, Int) ⇒ Unit): Unit

  26. def foreachTypeVar(op: (TypeVar) ⇒ Unit): Unit

    Perform operation op on all typevars, or only on uninstantiated typevars, depending on whether uninstOnly is set or not.

    Perform operation op on all typevars, or only on uninstantiated typevars, depending on whether uninstOnly is set or not.

    Definition Classes
    OrderingConstraintConstraint
  27. def fullBounds(param: PolyParam)(implicit ctx: Context): TypeBounds

    The bounds of param including all known-to-be-smaller and -greater parameters

    The bounds of param including all known-to-be-smaller and -greater parameters

    Definition Classes
    OrderingConstraintConstraint
  28. def fullLowerBound(param: PolyParam)(implicit ctx: Context): Type

    The lower bound of param including all known-to-be-smaller parameters

    The lower bound of param including all known-to-be-smaller parameters

    Definition Classes
    OrderingConstraintConstraint
  29. def fullUpperBound(param: PolyParam)(implicit ctx: Context): Type

    The upper bound of param including all known-to-be-greater parameters

    The upper bound of param including all known-to-be-greater parameters

    Definition Classes
    OrderingConstraintConstraint
  30. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  31. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  32. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  33. def isLess(param1: PolyParam, param2: PolyParam): Boolean

    Is it known that param1 <:< param2?

    Is it known that param1 <:< param2?

    Definition Classes
    OrderingConstraintConstraint
  34. def isRemovable(pt: PolyType): Boolean

    Is entry associated with pt removable? This is the case if all type parameters of the entry are associated with type variables which have their inst fields set.

    Is entry associated with pt removable? This is the case if all type parameters of the entry are associated with type variables which have their inst fields set.

    Definition Classes
    OrderingConstraintConstraint
  35. def lower(param: PolyParam): List[PolyParam]

    The parameters that are known to be smaller wrt <: than param

    The parameters that are known to be smaller wrt <: than param

    Definition Classes
    OrderingConstraintConstraint
  36. def minLower(param: PolyParam): List[PolyParam]

  37. def minUpper(param: PolyParam): List[PolyParam]

  38. def narrowBound(param: PolyParam, bound: Type, isUpper: Boolean)(implicit ctx: Context): This

    Narrow one of the bounds of type parameter param If isUpper is true, ensure that param <: bound, otherwise ensure that param >: bound.

    Narrow one of the bounds of type parameter param If isUpper is true, ensure that param <: bound, otherwise ensure that param >: bound.

    Definition Classes
    OrderingConstraintConstraint
  39. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  40. def nonParamBounds(param: PolyParam): TypeBounds

    The constraint bounds for given type parameter param.

    The constraint bounds for given type parameter param. Poly params that are known to be smaller or greater than param are not contained in the return bounds.

    Definition Classes
    OrderingConstraintConstraint
  41. final def notify(): Unit

    Definition Classes
    AnyRef
  42. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  43. def remove(pt: PolyType)(implicit ctx: Context): This

    A new constraint with all entries coming from pt removed.

    A new constraint with all entries coming from pt removed.

    Definition Classes
    OrderingConstraintConstraint
  44. def replace(param: PolyParam, tp: Type)(implicit ctx: Context): OrderingConstraint

    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, or a conservative approximation of it if that is needed to avoid cycles.

    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, or a conservative approximation of it if that is needed to avoid cycles. Occurrences nested inside a refinement or prefix are not affected.

    The reason we need to substitute top-level occurrences of the parameter is to deal with situations like the following. Say we have in the constraint

    P <: Q & String Q

    and we replace Q with P. Then substitution gives

    P <: P & String

    this would be a cyclic constraint is therefore changed by normalize and recombine below to

    P <: String

    approximating the RHS occurrence of P with Any. Without the substitution we would not find out where we need to approximate. Occurrences of parameters that are not top-level are not affected.

    Definition Classes
    OrderingConstraintConstraint
  45. def show(implicit ctx: Context): String

    The string representation of this showable element.

    The string representation of this showable element.

    Definition Classes
    Showable
  46. def showSummary(implicit ctx: Context): String

    Definition Classes
    Showable
  47. def showSummary(depth: Int)(implicit ctx: Context): String

    The summarized string representation of this showable element.

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

    Definition Classes
    Showable
  48. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  49. def toString(): String

    Definition Classes
    OrderingConstraint → AnyRef → Any
  50. def toText(printer: Printer): Text

    The text representation of this showable element.

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

    Definition Classes
    OrderingConstraintShowable
  51. def typeVarOfParam(param: PolyParam): Type

    The type variable corresponding to parameter param, or NoType, if param is not in constrained or is not paired with a type variable.

    The type variable corresponding to parameter param, or NoType, if param is not in constrained or is not paired with a type variable.

    Definition Classes
    OrderingConstraintConstraint
  52. def unify(p1: PolyParam, p2: PolyParam)(implicit ctx: Context): This

    A constraint resulting from adding p2 = p1 to this constraint, and at the same time transferring all bounds of p2 to p1

    A constraint resulting from adding p2 = p1 to this constraint, and at the same time transferring all bounds of p2 to p1

    Definition Classes
    OrderingConstraintConstraint
  53. def uninstVars: Seq[TypeVar]

    The uninstantiated typevars of this constraint

    The uninstantiated typevars of this constraint

    Definition Classes
    OrderingConstraintConstraint
  54. def updateEntry(param: PolyParam, tp: Type)(implicit ctx: Context): This

    A new constraint which is derived from this constraint by updating the entry for parameter param to tp.

    A new constraint which is derived from this constraint by updating the entry for parameter param to tp. tp can be one of the following:

    • A TypeBounds value, indicating new constraint bounds
    • Another type, indicating a solution for the parameter
    Definition Classes
    OrderingConstraintConstraint
  55. def updateEntry(current: This, param: PolyParam, tp: Type)(implicit ctx: Context): This

  56. def upper(param: PolyParam): List[PolyParam]

    The parameters that are known to be greater wrt <: than param

    The parameters that are known to be greater wrt <: than param

    Definition Classes
    OrderingConstraintConstraint
  57. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  58. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  59. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Constraint

Inherited from Showable

Inherited from AnyRef

Inherited from Any

Ungrouped