summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2008-06-19 14:45:54 +0000
committerMartin Odersky <odersky@gmail.com>2008-06-19 14:45:54 +0000
commit6ea801d8688a15b30302fde898119407c70e96e7 (patch)
treef9fa5aa8bfd88a3dab574be0a11747daca857101
parent85db410e24a8c64195911b6f2824258321a63442 (diff)
downloadscala-6ea801d8688a15b30302fde898119407c70e96e7.tar.gz
scala-6ea801d8688a15b30302fde898119407c70e96e7.tar.bz2
scala-6ea801d8688a15b30302fde898119407c70e96e7.zip
fixed t0590
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index 9f1d11f425..701b8e5f72 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -3408,6 +3408,10 @@ trait Typers { self: Analyzer =>
case PolyType(tparams, result) => core(result).subst(tparams, tparams map (t => core(t.info.bounds.hi)))
case _ => tp
}
+ def stripped(tp: Type): Type = {
+ val tparams = freeTypeParamsOfTerms.collect(tp)
+ tp.subst(tparams, tparams map (t => WildcardType))
+ }
def sum(xs: List[Int]) = (0 /: xs)(_ + _)
def complexity(tp: Type): Int = tp.normalize match {
case NoPrefix =>
@@ -3426,8 +3430,8 @@ trait Typers { self: Analyzer =>
case (_, RefinedType(parents, _)) => parents exists (overlaps(tp1, _))
case _ => tp1.typeSymbol == tp2.typeSymbol
}
- val dtor1 = core(dtor)
- val dted1 = core(dted)
+ val dtor1 = stripped(core(dtor))
+ val dted1 = stripped(core(dted))
overlaps(dtor1, dted1) && (dtor1 =:= dted1 || complexity(dtor1) > complexity(dted1))
}