diff options
author | Martin Odersky <odersky@gmail.com> | 2006-01-20 18:07:53 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2006-01-20 18:07:53 +0000 |
commit | b945b6d398974909828a2d07c855267159c06b3d (patch) | |
tree | 69e3f1e8838d94152d4a2e46a4751eabba45e86e /src/compiler | |
parent | e95af789da6f4831badf4620a03fca2a8f1bc64a (diff) | |
download | scala-b945b6d398974909828a2d07c855267159c06b3d.tar.gz scala-b945b6d398974909828a2d07c855267159c06b3d.tar.bz2 scala-b945b6d398974909828a2d07c855267159c06b3d.zip |
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Infer.scala | 5 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Typers.scala | 5 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Infer.scala b/src/compiler/scala/tools/nsc/typechecker/Infer.scala index 9c9c969b39..31b7c4a5db 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Infer.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Infer.scala @@ -560,8 +560,9 @@ mixin class Infer requires Analyzer { val tp2 = pre.memberType(sym2); (tp2 == ErrorType || !global.typer.infer.isCompatible(tp2, pt) && global.typer.infer.isCompatible(tp1, pt) || - (tp2.paramSectionCount > 0) && (tp1.paramSectionCount == 0 || specializes(tp1, tp2)) - )}) + ((tp2.paramSectionCount > 0 && !tp2.paramTypes.isEmpty) && (tp1.paramSectionCount == 0 || tp1.paramTypes.isEmpty)) || + specializes(tp1, tp2) && !specializes(tp2, tp1)) + }) ); val best = ((NoSymbol: Symbol) /: alts1) ((best, alt) => if (improves(alt, best)) alt else best); diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index cb83e6abbe..0cc3a4667f 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -353,9 +353,8 @@ mixin class Typers requires Analyzer { (pt <:< functionType(mt.paramTypes map (t => WildcardType), WildcardType))) { // (4.2) if (settings.debug.value) log("eta-expanding "+tree+":"+tree.tpe+" to "+pt) typed(etaExpand(tree), mode, pt) - } else if (!tree.symbol.isConstructor && - mt.paramTypes.isEmpty && isCompatible(mt.resultType, pt)) { // (4.3) - typed(Apply(tree, List()) setPos tree.pos) + } else if (!tree.symbol.isConstructor && mt.paramTypes.isEmpty) { // (4.3) + adapt(typed(Apply(tree, List()) setPos tree.pos), mode, pt) } else { if (context.reportGeneralErrors) { if (settings.migrate.value && !tree.symbol.isConstructor && isCompatible(mt, pt)) |