Why can't I overload two methods with default arguments, as shown below?
$scala
Welcome to Scala 2.12.0-M3 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_51).
Type in expressions for evaluation. Or try :help.
scala> :paste
// Entering paste mode (ctrl-D to finish)
def f(x: Int, y: String = "bar") = true
def f(x: Boolean, y: String = "foo") = false
// Exiting paste mode, now interpreting.
<console>:9: error: in object $iw, multiple overloaded alternatives of method f define default arguments.
object $iw {
^
Thanks,
Kevin
--
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-user+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.