Can this be done?
final case class C[A] (v: A) {
def this() = this(true)
}
When constructed with given constructor, C is automatically a C[Boolean]. This version does not compile but it feels like it should be doable somehow, especially as the following seems to work:
final case class C[A] (v: A = true)
I want some Java interoperability, so I try to avoid default values. I think that I can achieve this by using factory methods in a companion object, but can it be done directly? As C is a case class, factory methods are a bit messy IMHO.