aboutsummaryrefslogblamecommitdiff
path: root/tests/neg/overloaded.scala
blob: ce971ebcf4df4858c2c3c34e537b537aa664b0a9 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
















                                                 
// testing the limits of parameter type inference

object Test {
  def mapX(f: Char => Char): String = ???
  def mapX[U](f: U => U): U = ???
  mapX(x => x) // error: missing parameter type

  def foo(f: Char => Char): Unit = ???
  def foo(f: Int => Int): String = ???
  foo(x => x) // error: missing parameter type

  def bar(f: (Char, Char) => Unit): Unit = ???
  def bar(f: Char => Unit) = ???
  bar((x, y) => ())
  bar (x => ())

}