diff options
author | Martin Odersky <odersky@gmail.com> | 2014-03-17 18:05:57 +0100 |
---|---|---|
committer | Tobias Schlatter <tobias@meisch.ch> | 2014-03-21 11:28:30 +0100 |
commit | 0a1ec31c2a17c5dd0e6bd363979cbf17a8860616 (patch) | |
tree | 7ccdd57d90d231cc11f396f767044809e53d86e8 /src/dotty/tools/dotc/core/TypeComparer.scala | |
parent | 7820e62e30a63f2b8fd6b8bab8f96be6924a63a1 (diff) | |
download | dotty-0a1ec31c2a17c5dd0e6bd363979cbf17a8860616.tar.gz dotty-0a1ec31c2a17c5dd0e6bd363979cbf17a8860616.tar.bz2 dotty-0a1ec31c2a17c5dd0e6bd363979cbf17a8860616.zip |
Fix of t112606A - path dependent types
Needed an extra case in isSubType.
Diffstat (limited to 'src/dotty/tools/dotc/core/TypeComparer.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/TypeComparer.scala | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/core/TypeComparer.scala b/src/dotty/tools/dotc/core/TypeComparer.scala index 612b78f79..b0fc68ba8 100644 --- a/src/dotty/tools/dotc/core/TypeComparer.scala +++ b/src/dotty/tools/dotc/core/TypeComparer.scala @@ -536,7 +536,20 @@ class TypeComparer(initctx: Context) extends DotClass { (tp1.symbol eq NullClass) && tp2.dealias.typeSymbol.isNullableClass } case tp1: SingletonType => - isNewSubType(tp1.underlying.widenExpr, tp2) + isNewSubType(tp1.underlying.widenExpr, tp2) || { + // if tp2 == p.type and p: q.type then try tp1 <:< q.type as a last effort. + tp2 match { + case tp2: TermRef => + tp2.info match { + case tp2i: TermRef => + isSubType(tp1, tp2i) + case _ => + false + } + case _ => + false + } + } case tp1: RefinedType => isNewSubType(tp1.parent, tp2) case AndType(tp11, tp12) => |