aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-02-05 11:19:39 +0100
committerMartin Odersky <odersky@gmail.com>2016-02-05 11:19:39 +0100
commit55832b8020a498d9cd49e2de4f8a8a3ba696814c (patch)
treeabe374f24b00fef640cbb95e199af51bbcc41df1
parentc24ece505e53570566b499b817342a4dfa4087ff (diff)
downloaddotty-55832b8020a498d9cd49e2de4f8a8a3ba696814c.tar.gz
dotty-55832b8020a498d9cd49e2de4f8a8a3ba696814c.tar.bz2
dotty-55832b8020a498d9cd49e2de4f8a8a3ba696814c.zip
Fix docs and naming
-rw-r--r--src/dotty/tools/dotc/config/Config.scala9
-rw-r--r--src/dotty/tools/dotc/core/ConstraintHandling.scala6
2 files changed, 9 insertions, 6 deletions
diff --git a/src/dotty/tools/dotc/config/Config.scala b/src/dotty/tools/dotc/config/Config.scala
index 212defbbf..461a15ac8 100644
--- a/src/dotty/tools/dotc/config/Config.scala
+++ b/src/dotty/tools/dotc/config/Config.scala
@@ -15,11 +15,12 @@ object Config {
*/
final val checkConstraintsNonCyclic = false
- /** Like `checkConstraintsNonCyclic`, but all constrained parameters
- * are tested for direct or indirect dependencies, each time a
- * constraint is added in TypeComparer.
+ /** Make sure none of the bounds in an OrderingConstraint contains
+ * another constrained parameter at its toplevel (i.e. as an operand
+ * of a combination of &'s and |'s.). The check is performed each time
+ * a new bound is added to the constraint.
*/
- final val checkConstraintsNonCyclicTrans = false
+ final val checkConstraintsSeparated = false
/** Check that each constraint resulting from a subtype test
* is satisfiable.
diff --git a/src/dotty/tools/dotc/core/ConstraintHandling.scala b/src/dotty/tools/dotc/core/ConstraintHandling.scala
index 07e048ab3..d25de9742 100644
--- a/src/dotty/tools/dotc/core/ConstraintHandling.scala
+++ b/src/dotty/tools/dotc/core/ConstraintHandling.scala
@@ -45,7 +45,7 @@ trait ConstraintHandling {
}
}
}
- if (Config.checkConstraintsNonCyclicTrans)
+ if (Config.checkConstraintsSeparated)
assert(!occursIn(bound), s"$param occurs in $bound")
val c1 = constraint.narrowBound(param, bound, isUpper)
(c1 eq constraint) || {
@@ -252,11 +252,13 @@ trait ConstraintHandling {
* Some of the Ti are constrained parameters
*
* In each case we cannot record the relationship as an isLess, because
- * of he outer |/&. But we should not leave it in the constraint either
+ * of the outer |/&. But we should not leave it in the constraint either
* because that would risk making a parameter a subtype or supertype of a bound
* where the parameter occurs again at toplevel, which leads to cycles
* in the subtyping test. So we intentionally loosen the constraint in order
* to keep it safe. A test case that demonstrates the problem is i864.scala.
+ * Turn Config.checkConstraintsSeparated on to get an accurate diagnostic
+ * of the cycle when it is created.
*/
def prune(bound: Type): Type = bound match {
case bound: AndOrType =>