Skip to content

Commit 62a526e

Browse files
committed
Add more pos and neg tests
Tests suggested by @retronym's comments on issue #897.
1 parent 29104c9 commit 62a526e

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

tests/neg/function-arity.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,7 @@ object Test {
1818

1919
unary[(Int, Int)]((x: String, y) => ()) // error
2020

21-
21+
def foo(a: Tuple2[Int, Int] => String): String = ""
22+
def foo(a: Any => String) = ()
23+
foo((a: Int, b: String) => a + b) // error: none of the overloaded alternatives of method foo match arguments (Int, Int)
2224
}

tests/pos/function-arity.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,7 @@ object Test {
1414
unary(1, 2, (x: Int, y: Float) => x)
1515

1616
val xs = List(1, 2, 3)
17+
def f(x: Int, y: Int) = x * y
1718
xs.zipWithIndex.map(_ + _)
19+
xs.zipWithIndex.map(f)
1820
}

0 commit comments

Comments
 (0)