diff options
author | Martin Odersky <odersky@gmail.com> | 2017-01-11 08:49:52 +0700 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2017-01-11 08:49:52 +0700 |
commit | 918a3fba3ceeebf0bc3e0087f9ead63f4ae30381 (patch) | |
tree | 249cac53d97347c6a1a9e26cf0a6195007c0c88b /compiler | |
parent | 2144462b39a6d92d7c3653e9bb242d116a60caba (diff) | |
download | dotty-918a3fba3ceeebf0bc3e0087f9ead63f4ae30381.tar.gz dotty-918a3fba3ceeebf0bc3e0087f9ead63f4ae30381.tar.bz2 dotty-918a3fba3ceeebf0bc3e0087f9ead63f4ae30381.zip |
Add more explanation.
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/src/dotty/tools/dotc/core/TypeComparer.scala | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/src/dotty/tools/dotc/core/TypeComparer.scala b/compiler/src/dotty/tools/dotc/core/TypeComparer.scala index baebd4214..6063cbf38 100644 --- a/compiler/src/dotty/tools/dotc/core/TypeComparer.scala +++ b/compiler/src/dotty/tools/dotc/core/TypeComparer.scala @@ -381,6 +381,9 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling { // where the subtype relation is true without needing to add a constraint // It's tricky because we might need to either appriximate tp2 by its // lower bound or else widen tp1 and check that the result is a subtype of tp2. + // So if the constraint is not yet frozen, we do the same comparison again + // with a frozen constraint, which means that we get a chance to do the + // widening in `fourthTry` before adding to the constraint. if (frozenConstraint || alwaysFluid) isSubType(tp1, bounds(tp2).lo) else isSubTypeWhenFrozen(tp1, tp2) alwaysTrue || { |