summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Infer.scala3
-rw-r--r--test/files/run/t3761-overload-byname.check2
-rw-r--r--test/files/run/t3761-overload-byname.scala5
3 files changed, 8 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Infer.scala b/src/compiler/scala/tools/nsc/typechecker/Infer.scala
index 34b951a797..f902198dda 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Infer.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Infer.scala
@@ -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)
diff --git a/test/files/run/t3761-overload-byname.check b/test/files/run/t3761-overload-byname.check
index 9410a4fe65..3a0a273e64 100644
--- a/test/files/run/t3761-overload-byname.check
+++ b/test/files/run/t3761-overload-byname.check
@@ -2,3 +2,5 @@ hello!
hello working world
goodnight!
goodnight moon, nobody, noises everywhere
+0
+1
diff --git a/test/files/run/t3761-overload-byname.scala b/test/files/run/t3761-overload-byname.scala
index 0e2c9b1059..b1656c97ba 100644
--- a/test/files/run/t3761-overload-byname.scala
+++ b/test/files/run/t3761-overload-byname.scala
@@ -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))
}
}