Skip to content

Commit

Permalink
Add more pos and neg tests
Browse files Browse the repository at this point in the history
Tests suggested by @retronym's comments on issue scala#897.
  • Loading branch information
odersky committed Feb 16, 2016
1 parent 29104c9 commit 62a526e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/neg/function-arity.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
2 changes: 2 additions & 0 deletions tests/pos/function-arity.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

0 comments on commit 62a526e

Please sign in to comment.