aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/neg/function-arity.scala4
-rw-r--r--tests/pos/function-arity.scala2
2 files changed, 5 insertions, 1 deletions
diff --git a/tests/neg/function-arity.scala b/tests/neg/function-arity.scala
index 83aa94482..86fbab49f 100644
--- a/tests/neg/function-arity.scala
+++ b/tests/neg/function-arity.scala
@@ -18,5 +18,7 @@ object Test {
unary[(Int, Int)]((x: String, y) => ()) // error
-
+ def foo(a: Tuple2[Int, Int] => String): String = ""
+ def foo(a: Any => String) = ()
+ foo((a: Int, b: String) => a + b) // error: none of the overloaded alternatives of method foo match arguments (Int, Int)
}
diff --git a/tests/pos/function-arity.scala b/tests/pos/function-arity.scala
index bb1a1cb8e..ec531c0ef 100644
--- a/tests/pos/function-arity.scala
+++ b/tests/pos/function-arity.scala
@@ -14,5 +14,7 @@ object Test {
unary(1, 2, (x: Int, y: Float) => x)
val xs = List(1, 2, 3)
+ def f(x: Int, y: Int) = x * y
xs.zipWithIndex.map(_ + _)
+ xs.zipWithIndex.map(f)
}