diff options
Diffstat (limited to 'compiler/src/dotty/tools/dotc/core')
-rw-r--r-- | compiler/src/dotty/tools/dotc/core/TypeComparer.scala | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/src/dotty/tools/dotc/core/TypeComparer.scala b/compiler/src/dotty/tools/dotc/core/TypeComparer.scala index f78820fff..fd954c688 100644 --- a/compiler/src/dotty/tools/dotc/core/TypeComparer.scala +++ b/compiler/src/dotty/tools/dotc/core/TypeComparer.scala @@ -541,9 +541,11 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling { /** if `tp2 == p.type` and `p: q.type` then try `tp1 <:< q.type` as a last effort.*/ def comparePaths = tp2 match { case tp2: TermRef => - tp2.info.widenExpr match { + tp2.info.widenExpr.dealias match { case tp2i: SingletonType => - isSubType(tp1, tp2i) // see z1720.scala for a case where this can arise even in typer. + isSubType(tp1, tp2i) + // see z1720.scala for a case where this can arise even in typer. + // Also, i1753.scala, to show why the dealias above is necessary. case _ => false } case _ => |