dotty.tools.dotc.core

Constraint

Related Doc: package core

abstract class Constraint extends Showable

Constraint over undetermined type parameters. Constraints are built over values of the following types:

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

Instance Constructors

  1. new Constraint()

Type Members

  1. abstract type This <: Constraint

Abstract Value Members

  1. abstract def &(other: Constraint)(implicit ctx: Context): Constraint

    The weakest constraint that subsumes both this constraint and other

  2. abstract 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.

  3. abstract def addLess(p1: PolyParam, p2: 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.

  4. abstract def checkClosed()(implicit ctx: Context): Unit

    Check that constraint only refers to PolyParams bound by itself

  5. abstract def checkNonCyclic()(implicit ctx: Context): Unit

    Check that no constrained parameter contains itself as a bound

  6. abstract def contains(tvar: TypeVar): Boolean

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

  7. abstract def contains(param: PolyParam): Boolean

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

  8. abstract def contains(pt: PolyType): Boolean

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

  9. abstract def domainParams: List[PolyParam]

    The polytype parameters constrained by this constraint

  10. abstract def domainPolys: List[PolyType]

    The polytypes constrained by this constraint

  11. abstract def entry(param: PolyParam): Type

    The constraint entry for given type parameter param, or NoType if param is not part of the constraint domain.

    The constraint entry for given type parameter param, or NoType if param is not part of the constraint domain. Note: Low level, implementation dependent.

  12. abstract def exclusiveLower(param: PolyParam, butNot: PolyParam): List[PolyParam]

    lower(param) \ lower(butNot)

  13. abstract def exclusiveUpper(param: PolyParam, butNot: PolyParam): List[PolyParam]

    upper(param) \ upper(butNot)

  14. abstract def forallParams(p: (PolyParam) ⇒ Boolean): Boolean

    Check whether predicate holds for all parameters in constraint

  15. abstract 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.

  16. abstract def fullBounds(param: PolyParam)(implicit ctx: Context): TypeBounds

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

  17. abstract def fullLowerBound(param: PolyParam)(implicit ctx: Context): Type

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

  18. abstract def fullUpperBound(param: PolyParam)(implicit ctx: Context): Type

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

  19. abstract def isLess(param1: PolyParam, param2: PolyParam): Boolean

    Is it known that param1 <:< param2?

  20. abstract 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.

  21. abstract def lower(param: PolyParam): List[PolyParam]

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

  22. abstract 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.

  23. abstract 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.

  24. abstract def remove(pt: PolyType)(implicit ctx: Context): This

    A new constraint with all entries coming from pt removed.

  25. abstract def replace(param: PolyParam, tp: Type)(implicit ctx: 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, 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.

  26. abstract 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
    Showable
  27. abstract 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.

  28. abstract 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

  29. abstract def uninstVars: Seq[TypeVar]

    The uninstantiated typevars of this constraint

  30. abstract 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
  31. abstract def upper(param: PolyParam): List[PolyParam]

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

Concrete Value Members

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

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

    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  5. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. final def eq(arg0: AnyRef): Boolean

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

    Definition Classes
    AnyRef → Any
  8. 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
  9. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  10. final def getClass(): Class[_]

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

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

    Definition Classes
    Any
  13. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  14. final def notify(): Unit

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

    Definition Classes
    AnyRef
  16. def show(implicit ctx: Context): String

    The string representation of this showable element.

    The string representation of this showable element.

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

    Definition Classes
    Showable
  18. 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
  19. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  20. def toString(): String

    Definition Classes
    AnyRef → Any
  21. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Showable

Inherited from AnyRef

Inherited from Any

Ungrouped