I want to access parent class constructor from ext...
# getting-started
k
I want to access parent class constructor from extended class. Like this.. How can I do this ?
Copy code
class A {
  generateInstance(): this:class {
     return this::class()
  }
}
class B: A() 
val b: B = B().generateInstance()
e
k
Thank you. I am surprised to know that there is something kotlin cannot do. Kotlin seemed too perfect.
a
What is "trait" ?
t
in very early versions of kotlin they used the keyword
trait
instead of
interface
a
Oh I see thanks !