diff options
author | Paul Phillips <paulp@improving.org> | 2011-06-30 22:42:27 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-06-30 22:42:27 +0000 |
commit | 9d02b4adea3512e671e97c11dec9dd7fd8514c49 (patch) | |
tree | a99ef6484c67f4cf434047c4c116afa2213da837 | |
parent | bf65e48526e022a520d8c88f8a4a290fd6494daa (diff) | |
download | scala-9d02b4adea3512e671e97c11dec9dd7fd8514c49.tar.gz scala-9d02b4adea3512e671e97c11dec9dd7fd8514c49.tar.bz2 scala-9d02b4adea3512e671e97c11dec9dd7fd8514c49.zip |
Further refinement of the tiark RefinedType patch.
I think this is fastest and simplest both. Review by rompf.
-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) |