How can I call a super's extension function?
For example:
open class Parent {
open fun String.print() = println(this)
}
class Child : Parent() {
override fun String.print() {
print("child says ")
super.print() // syntax error on this
}
}
Even though the
print()function is defined inside ofParent, it belongs toString, not toParent. So there's noprintfunction that you can call onParent, which is what you're trying to do withsuper.I don't think there's syntax support for the type of call you're trying to do in Kotlin.