<Constructor with default values> Is there a solut...
# forum
r
Constructor with default values Is there a solution to provide sensible default values for constructor parameters automatically? For example in case of the following class: @WithDefaults class A(p1 : Int, p2 : String, p3 : String?, p4: List, p5 : SomeClass) { } I would like to have an empty constructor added automatically: @WithDefaults class A(p1 : Int, p2 : String, p3 : String?, p4 : List) { constructor() : this(0, "", null, emptyList(), SomeClass()) } The whole point would be not to write out the default values. I...