diff options
author | Martin Odersky <odersky@gmail.com> | 2014-01-24 08:58:51 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2014-01-26 18:52:33 +0100 |
commit | f01071323516e699a169d89e5ac848215b6488c2 (patch) | |
tree | e1748ff03980ebe605171ad9d5601b24f31ff813 /src/dotty/tools/dotc/core/Types.scala | |
parent | ea241b57322ccb818c6a95effc28e0db6d4f38b2 (diff) | |
download | dotty-f01071323516e699a169d89e5ac848215b6488c2.tar.gz dotty-f01071323516e699a169d89e5ac848215b6488c2.tar.bz2 dotty-f01071323516e699a169d89e5ac848215b6488c2.zip |
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.
Diffstat (limited to 'src/dotty/tools/dotc/core/Types.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/Types.scala | 2 |
1 files changed, 1 insertions, 1 deletions
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 } |