@@ -13,64 +13,64 @@ import config.Printers.constr
1313/** Constraint over undetermined type parameters. Constraints are built
1414 * over values of the following types:
1515 *
16- * - PolyType A constraint constrains the type parameters of a set of PolyTypes
17- * - PolyParam The parameters of the constrained polytypes
18- * - TypeVar Every constrained parameter might be associated with a TypeVar
19- * that has the PolyParam as origin.
16+ * - TypeLambda A constraint constrains the type parameters of a set of TypeLambdas
17+ * - TypeParamRef The parameters of the constrained type lambdas
18+ * - TypeVar Every constrained parameter might be associated with a TypeVar
19+ * that has the TypeParamRef as origin.
2020 */
2121abstract class Constraint extends Showable {
2222
2323 type This <: Constraint
2424
2525 /** Does the constraint's domain contain the type parameters of `pt`? */
26- def contains (pt : PolyType ): Boolean
26+ def contains (pt : TypeLambda ): Boolean
2727
2828 /** Does the constraint's domain contain the type parameter `param`? */
29- def contains (param : PolyParam ): Boolean
29+ def contains (param : TypeParamRef ): Boolean
3030
3131 /** Does this constraint contain the type variable `tvar` and is it uninstantiated? */
3232 def contains (tvar : TypeVar ): Boolean
3333
3434 /** The constraint entry for given type parameter `param`, or NoType if `param` is not part of
3535 * the constraint domain. Note: Low level, implementation dependent.
3636 */
37- def entry (param : PolyParam ): Type
37+ def entry (param : TypeParamRef ): Type
3838
3939 /** The type variable corresponding to parameter `param`, or
4040 * NoType, if `param` is not in constrained or is not paired with a type variable.
4141 */
42- def typeVarOfParam (param : PolyParam ): Type
42+ def typeVarOfParam (param : TypeParamRef ): Type
4343
4444 /** Is it known that `param1 <:< param2`? */
45- def isLess (param1 : PolyParam , param2 : PolyParam ): Boolean
45+ def isLess (param1 : TypeParamRef , param2 : TypeParamRef ): Boolean
4646
4747 /** The parameters that are known to be smaller wrt <: than `param` */
48- def lower (param : PolyParam ): List [PolyParam ]
48+ def lower (param : TypeParamRef ): List [TypeParamRef ]
4949
5050 /** The parameters that are known to be greater wrt <: than `param` */
51- def upper (param : PolyParam ): List [PolyParam ]
51+ def upper (param : TypeParamRef ): List [TypeParamRef ]
5252
5353 /** lower(param) \ lower(butNot) */
54- def exclusiveLower (param : PolyParam , butNot : PolyParam ): List [PolyParam ]
54+ def exclusiveLower (param : TypeParamRef , butNot : TypeParamRef ): List [TypeParamRef ]
5555
5656 /** upper(param) \ upper(butNot) */
57- def exclusiveUpper (param : PolyParam , butNot : PolyParam ): List [PolyParam ]
57+ def exclusiveUpper (param : TypeParamRef , butNot : TypeParamRef ): List [TypeParamRef ]
5858
5959 /** The constraint bounds for given type parameter `param`.
6060 * Poly params that are known to be smaller or greater than `param`
6161 * are not contained in the return bounds.
6262 * @pre `param` is not part of the constraint domain.
6363 */
64- def nonParamBounds (param : PolyParam ): TypeBounds
64+ def nonParamBounds (param : TypeParamRef ): TypeBounds
6565
6666 /** The lower bound of `param` including all known-to-be-smaller parameters */
67- def fullLowerBound (param : PolyParam )(implicit ctx : Context ): Type
67+ def fullLowerBound (param : TypeParamRef )(implicit ctx : Context ): Type
6868
6969 /** The upper bound of `param` including all known-to-be-greater parameters */
70- def fullUpperBound (param : PolyParam )(implicit ctx : Context ): Type
70+ def fullUpperBound (param : TypeParamRef )(implicit ctx : Context ): Type
7171
7272 /** The bounds of `param` including all known-to-be-smaller and -greater parameters */
73- def fullBounds (param : PolyParam )(implicit ctx : Context ): TypeBounds
73+ def fullBounds (param : TypeParamRef )(implicit ctx : Context ): TypeBounds
7474
7575 /** A new constraint which is derived from this constraint by adding
7676 * entries for all type parameters of `poly`.
@@ -79,7 +79,7 @@ abstract class Constraint extends Showable {
7979 * satisfiability but will solved to give instances of
8080 * type variables.
8181 */
82- def add (poly : PolyType , tvars : List [TypeVar ])(implicit ctx : Context ): This
82+ def add (poly : TypeLambda , tvars : List [TypeVar ])(implicit ctx : Context ): This
8383
8484 /** A new constraint which is derived from this constraint by updating
8585 * the entry for parameter `param` to `tp`.
@@ -90,44 +90,44 @@ abstract class Constraint extends Showable {
9090 *
9191 * @pre `this contains param`.
9292 */
93- def updateEntry (param : PolyParam , tp : Type )(implicit ctx : Context ): This
93+ def updateEntry (param : TypeParamRef , tp : Type )(implicit ctx : Context ): This
9494
9595 /** A constraint that includes the relationship `p1 <: p2`.
9696 * `<:` relationships between parameters ("edges") are propagated, but
9797 * non-parameter bounds are left alone.
9898 */
99- def addLess (p1 : PolyParam , p2 : PolyParam )(implicit ctx : Context ): This
99+ def addLess (p1 : TypeParamRef , p2 : TypeParamRef )(implicit ctx : Context ): This
100100
101101 /** A constraint resulting from adding p2 = p1 to this constraint, and at the same
102102 * time transferring all bounds of p2 to p1
103103 */
104- def unify (p1 : PolyParam , p2 : PolyParam )(implicit ctx : Context ): This
104+ def unify (p1 : TypeParamRef , p2 : TypeParamRef )(implicit ctx : Context ): This
105105
106106 /** A new constraint which is derived from this constraint by removing
107107 * the type parameter `param` from the domain and replacing all top-level occurrences
108108 * of the parameter elsewhere in the constraint by type `tp`, or a conservative
109109 * approximation of it if that is needed to avoid cycles.
110110 * Occurrences nested inside a refinement or prefix are not affected.
111111 */
112- def replace (param : PolyParam , tp : Type )(implicit ctx : Context ): This
112+ def replace (param : TypeParamRef , tp : Type )(implicit ctx : Context ): This
113113
114114 /** Is entry associated with `pt` removable? This is the case if
115115 * all type parameters of the entry are associated with type variables
116116 * which have their `inst` fields set.
117117 */
118- def isRemovable (pt : PolyType ): Boolean
118+ def isRemovable (pt : TypeLambda ): Boolean
119119
120120 /** A new constraint with all entries coming from `pt` removed. */
121- def remove (pt : PolyType )(implicit ctx : Context ): This
121+ def remove (pt : TypeLambda )(implicit ctx : Context ): This
122122
123- /** The polytypes constrained by this constraint */
124- def domainPolys : List [PolyType ]
123+ /** The type lambdas constrained by this constraint */
124+ def domainLambdas : List [TypeLambda ]
125125
126- /** The polytype parameters constrained by this constraint */
127- def domainParams : List [PolyParam ]
126+ /** The type lambda parameters constrained by this constraint */
127+ def domainParams : List [TypeParamRef ]
128128
129129 /** Check whether predicate holds for all parameters in constraint */
130- def forallParams (p : PolyParam => Boolean ): Boolean
130+ def forallParams (p : TypeParamRef => Boolean ): Boolean
131131
132132 /** Perform operation `op` on all typevars, or only on uninstantiated
133133 * typevars, depending on whether `uninstOnly` is set or not.
@@ -143,6 +143,6 @@ abstract class Constraint extends Showable {
143143 /** Check that no constrained parameter contains itself as a bound */
144144 def checkNonCyclic ()(implicit ctx : Context ): Unit
145145
146- /** Check that constraint only refers to PolyParams bound by itself */
146+ /** Check that constraint only refers to TypeParamRefs bound by itself */
147147 def checkClosed ()(implicit ctx : Context ): Unit
148148}
0 commit comments