aboutsummaryrefslogtreecommitdiff
path: root/tests/neg/amp.scala
blob: 92062eb0d4e9d78c27560f05000156897da073c2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
object Test extends dotty.runtime.LegacyApp {

  def foo() = {
    def f: Int = 1
    val x = f _ // error: not a function: => Int(f)
    x
  }

  def bar(g: => Int) = {
    g _ // error: not a function: => Int(g)
  }

  Console.println((bar{ Console.println("g called"); 42 })()) // error: method bar in object Test$ does not take more parameters
  Console.println(foo()()) // error: method foo in object Test$ does not take more parameters
}