diff options
author | Martin Odersky <odersky@gmail.com> | 2010-06-20 22:51:10 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2010-06-20 22:51:10 +0000 |
commit | b040ad441b8a9d89c9ea6d890381ed61d0285f25 (patch) | |
tree | 2310072017c9808240df2f414cd215451850ad4f | |
parent | c084ad2bcd697b7678888e1bf09470b37d2199f9 (diff) | |
download | scala-b040ad441b8a9d89c9ea6d890381ed61d0285f25.tar.gz scala-b040ad441b8a9d89c9ea6d890381ed61d0285f25.tar.bz2 scala-b040ad441b8a9d89c9ea6d890381ed61d0285f25.zip |
Changed inference algorithm to use weak
<:< instead of <:< for all compatibility tests
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Infer.scala | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Infer.scala b/src/compiler/scala/tools/nsc/typechecker/Infer.scala index 31bb86994e..a2594a060b 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Infer.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Infer.scala @@ -344,7 +344,7 @@ trait Infer { def isCompatible(tp: Type, pt: Type): Boolean = { val tp1 = normalize(tp) - (tp1 <:< pt) || isCoercible(tp1, pt) + (tp1 weak_<:< pt) || isCoercible(tp1, pt) } final def normSubType(tp: Type, pt: Type): Boolean = tp match { @@ -1595,6 +1595,8 @@ trait Infer { var allApplicable = alts filter (alt => isApplicable(undetparams, followApply(pre.memberType(alt)), argtpes, pt)) + //log("applicable: "+ (allApplicable map pre.memberType)) + if (varArgsOnly) allApplicable = allApplicable filter (alt => isVarArgs(alt.tpe.params)) |