File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -15,11 +15,12 @@ object Config {
15
15
*/
16
16
final val checkConstraintsNonCyclic = false
17
17
18
- /** Like `checkConstraintsNonCyclic`, but all constrained parameters
19
- * are tested for direct or indirect dependencies, each time a
20
- * constraint is added in TypeComparer.
18
+ /** Make sure none of the bounds in an OrderingConstraint contains
19
+ * another constrained parameter at its toplevel (i.e. as an operand
20
+ * of a combination of &'s and |'s.). The check is performed each time
21
+ * a new bound is added to the constraint.
21
22
*/
22
- final val checkConstraintsNonCyclicTrans = false
23
+ final val checkConstraintsSeparated = false
23
24
24
25
/** Check that each constraint resulting from a subtype test
25
26
* is satisfiable.
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ trait ConstraintHandling {
45
45
}
46
46
}
47
47
}
48
- if (Config .checkConstraintsNonCyclicTrans )
48
+ if (Config .checkConstraintsSeparated )
49
49
assert(! occursIn(bound), s " $param occurs in $bound" )
50
50
val c1 = constraint.narrowBound(param, bound, isUpper)
51
51
(c1 eq constraint) || {
@@ -252,11 +252,13 @@ trait ConstraintHandling {
252
252
* Some of the Ti are constrained parameters
253
253
*
254
254
* In each case we cannot record the relationship as an isLess, because
255
- * of he outer |/&. But we should not leave it in the constraint either
255
+ * of the outer |/&. But we should not leave it in the constraint either
256
256
* because that would risk making a parameter a subtype or supertype of a bound
257
257
* where the parameter occurs again at toplevel, which leads to cycles
258
258
* in the subtyping test. So we intentionally loosen the constraint in order
259
259
* to keep it safe. A test case that demonstrates the problem is i864.scala.
260
+ * Turn Config.checkConstraintsSeparated on to get an accurate diagnostic
261
+ * of the cycle when it is created.
260
262
*/
261
263
def prune (bound : Type ): Type = bound match {
262
264
case bound : AndOrType =>
You can’t perform that action at this time.
0 commit comments