Is there any difference between these two?
fun <T : Parent> T.function() {}
vs.
fun Parent.function() {}
CodePudding user response:
As you wrote it - no.
It is important for function chaining:
fun <T : Parent> T.function():T { return this } //allows chaining
vs.
fun Parent.function():Parent { return this } //casts to base class