According to eptx
Functions don't support parameter defaults. Methods do. Converting
from a method to a function loses parameter defaults. (Scala 2.8.1)
Printing -Xprint:typer compilation phase of
object Foo {
def a(i: Int, s: String = "please autocomplete this param") = i
}
gives something like
def a(i: Int, s: String = "please autocomplete this param"): Int = i;
<synthetic> def a$default$2: String = "please autocomplete this param"
where we see default argument is available as a$default$2. So we could do something we should definitely NOT do and combine implicit conversion with compiler-implementation-dependent detail
object Foo {
def a(i: Int, s: String = "please autocomplete this param") = i
def b = (a _).tupled.andThen(println(_))
implicit def xToTupleWithDefault(x: Int): (Int, String) = (x, a$default$2)
}
import Foo._
b(2) // expands to b(xToTupleWithDefault(2))