From f01071323516e699a169d89e5ac848215b6488c2 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Fri, 24 Jan 2014 08:58:51 +0100 Subject: Fixing two bugs in subtype checking that cancelled each other out. 1. The occursInCheck hat its logic crossed, which led to some cycles in constraints not being detected. 2. The logic around addConstraint skipped some necessary comparisons when frozenConstraint was set. Fixing the addConstraint logic created new subtype cases which made constraints cyclic without that fact being detected. --- src/dotty/tools/dotc/core/Types.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/dotty/tools/dotc/core/Types.scala') diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala index 622672515..bfe4ae5be 100644 --- a/src/dotty/tools/dotc/core/Types.scala +++ b/src/dotty/tools/dotc/core/Types.scala @@ -1701,7 +1701,7 @@ object Types { case bound: AndOrType => def occ1 = occursIn(bound.tp1, fromBelow) def occ2 = occursIn(bound.tp2, fromBelow) - if (fromBelow == bound.isAnd) occ1 || occ2 else occ1 & occ2 + if (fromBelow == bound.isAnd) occ1 & occ2 else occ1 || occ2 case _ => false } -- cgit v1.2.3