aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/TypeComparer.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-01-23 12:08:00 +0100
committerMartin Odersky <odersky@gmail.com>2014-01-26 18:52:33 +0100
commitea241b57322ccb818c6a95effc28e0db6d4f38b2 (patch)
tree02977056621fc5f471110d58f97dd8f3e85e2ad3 /src/dotty/tools/dotc/core/TypeComparer.scala
parentb9731483ae3e55399336f6c7e94c7490ae1da7ce (diff)
downloaddotty-ea241b57322ccb818c6a95effc28e0db6d4f38b2.tar.gz
dotty-ea241b57322ccb818c6a95effc28e0db6d4f38b2.tar.bz2
dotty-ea241b57322ccb818c6a95effc28e0db6d4f38b2.zip
Try to dealias LHS in <:< where possible.
Diffstat (limited to 'src/dotty/tools/dotc/core/TypeComparer.scala')
-rw-r--r--src/dotty/tools/dotc/core/TypeComparer.scala8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/dotty/tools/dotc/core/TypeComparer.scala b/src/dotty/tools/dotc/core/TypeComparer.scala
index 6b8703f92..c978affb6 100644
--- a/src/dotty/tools/dotc/core/TypeComparer.scala
+++ b/src/dotty/tools/dotc/core/TypeComparer.scala
@@ -615,9 +615,9 @@ class TypeComparer(initctx: Context) extends DotClass {
NamedType(tp1.prefix, tp1.name, sd.derivedSingleDenotation(sd.symbol, tp))
secondTry(OrType(derivedRef(tp11), derivedRef(tp12)), tp2)
case TypeBounds(lo1, hi1) =>
- /*if (lo1 eq hi1) isSubType(hi1, tp2.dealias)
- else*/ if ((tp1.symbol is GADTFlexType) && !isSubTypeWhenFrozen(hi1, tp2))
+ if ((tp1.symbol is GADTFlexType) && !isSubTypeWhenFrozen(hi1, tp2))
trySetType(tp1, TypeBounds(lo1, hi1 & tp2))
+ else if (lo1 eq hi1) isSubType(hi1, tp2)
else thirdTry(tp1, tp2)
case _ =>
thirdTry(tp1, tp2)
@@ -811,8 +811,8 @@ class TypeComparer(initctx: Context) extends DotClass {
/** Can type `tp` be constrained from above by adding a constraint to
* a typevar that it refers to? In that case we have to be careful not
- * to approximate with the lower bound of a type in `thridTryNamed`. Instead,
- * we should first unroll `tp1` until we hit the type variable and bound the
+ * to approximate with the lower bound of a type in `thirdTry`. Instead,
+ * we should first unroll `tp1` until we hit the type variable and bind the
* type variable with (the corresponding type in) `tp2` instead.
*/
def isCappable(tp: Type): Boolean = tp match {