Permalink
Browse files

SI-3761: Overload resolution fails on by-name parameter (amended per …

…lrytz)

Lukas noted the stopgap at methTypeArgs isn't needed. What! No black tie formals.
  • Loading branch information...
som-snytt committed May 22, 2012
1 parent f6a4d94 commit 8de2caa560d2c820269fd30207fdd22dd7e48c6b
@@ -694,8 +694,7 @@ trait Infer {
isCompatibleArgs(argtpes, formals) && isWeaklyCompatible(restpe, pt)
} else {
try {
- val blackTie = formalTypes(params map { _.tpe }, argtpes0.length)
- val AdjustedTypeArgs.Undets(okparams, okargs, leftUndet) = methTypeArgs(undetparams, blackTie, restpe, argtpes, pt)
+ val AdjustedTypeArgs.Undets(okparams, okargs, leftUndet) = methTypeArgs(undetparams, formals, restpe, argtpes, pt)
// #2665: must use weak conformance, not regular one (follow the monomorphic case above)
(exprTypeArgs(leftUndet, restpe.instantiateTypeParams(okparams, okargs), pt, useWeaklyCompatible = true)._1 ne null) &&
isWithinBounds(NoPrefix, NoSymbol, okparams, okargs)
@@ -2,3 +2,5 @@ hello!
hello working world
goodnight!
goodnight moon, nobody, noises everywhere
+0
+1
@@ -6,6 +6,9 @@ class OverTheTop {
// as reported
def info1(m: =>String) = m + "!"
def info1(m: =>String, args: Any*) = m +" "+ args.mkString(", ")
+
+ // @lrytz
+ def m[A](x: => Int) = 0; def m[A](x: => Int, xs: Int*) = 1
}
object Test {
def main(args: Array[String]) {
@@ -14,5 +17,7 @@ object Test {
println(top.info0("hello","working","world"))
println(top.info1("goodnight"))
println(top.info1("goodnight", "moon", "nobody", "noises everywhere"))
+ println(top.m(17))
+ println(top.m(17,19))
}
}

0 comments on commit 8de2caa

Please sign in to comment.