joscha.alisch
10/18/2017, 7:09 PMobject A {
val string : String = "hallo"
fun String.doSomething() { }
}
fun test() {
with(A) {
string.doSomething()
}
}
Is there any way of adding such an extension function to a class when I cant modify it? Kind of like in the following pseudo-code:
object A {
val string : String = "hallo"
}
fun A.String.doSomething() { }