Closed
Description
Compiler version
3.0.0-RC3
Minimized code
def foo(f: => () => Unit): Unit = ???
def boo(f: [A] => () => Unit): Unit = ???
foo { () => // okay
println(1)
println(2)
}
boo { [A] => () => // error
println(1)
println(2)
}
boo { [A] => () => { // okay
println(1)
println(2)
}}
Output
A pure expression does nothing in statement position; you may be omitting necessary parentheses [194:13]
Found: Unit
Required: PolyFunction{apply: [A](): Unit} [196:12]
Expectation
Same lightweight syntax for polymorphic functions as for "standard" functions
Also by-name parameter support for polymorphic functions could be useful for even clearer syntax.