In other languages like Swift, there is the possibility of creating a function extension that adds a new constructor.
Something like this:
// base class
class Whatever() {
...
}
// constructor method extension
fun Whatever.constructor(potato: String) {
setPotato(potato)
}
fun main(args: Array<String>) {
println(Whatever("holi"))
}
Are there any means to do this in Kotlin?