I am using the Scala 2.8 default parameters on a constructor, and for Java compatibility reasons, I wanted a no-arg constructor that uses the default parameters.
This doesn't work for very sensible reasons:
class MyClass(field1: String = "foo", field2: String = "bar") {
def this() = {
this() // <-- Does not compile, but how do I not duplicate the defaults?
}
}
I am wondering if there is anything that I am missing. Any thoughts that don't require duplicating the parameter defaults?
Thanks!