diff options
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Infer.scala | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Infer.scala b/src/compiler/scala/tools/nsc/typechecker/Infer.scala index 0fe50cb76e..a8c54d48e0 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Infer.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Infer.scala @@ -425,11 +425,10 @@ trait Infer { private def isPlausiblySubType(tp1: Type, tp2: Type) = !isImpossibleSubType(tp1, tp2) private def isImpossibleSubType(tp1: Type, tp2: Type) = tp1.normalize.widen match { case tr1 @ TypeRef(_, sym1, _) => - // If the lhs is an abstract type, we can't rule out a subtype - // relationship because we don't know what it is. - !sym1.isAbstractType && (tp2.normalize.widen match { + // We can only rule out a subtype relationship if the left hand + // side is a class, else we may not know enough. + sym1.isClass && (tp2.normalize.widen match { case TypeRef(_, sym2, _) => - sym1.isClass && sym2.isClass && !(sym1 isSubClass sym2) && !(sym1 isNumericSubClass sym2) |