kotlin, how to simplify passing parameters to base class constructor?
问题 We have a package that we are looking to convert to kotlin from python in order to then be able to migrate systems using that package. Within the package there are a set of classes that are all variants, or 'flavours' of a common base class. Most of the code is in the base class which has a significant number of optional parameters. So consider: open class BaseTree(val height:Int=10,val roots:Boolean=true, //...... lots more!! class FruitTree(val fruitSize, height:Int=10, roots:Boolean=true,