bbaldino
10/02/2020, 8:53 PMclass Foo {
fun String.someStringExtension() { ... }
}
fun Foo.String.someOtherStringExtension() { ... }
Arkadii Ivanov
10/02/2020, 11:02 PMbbaldino
10/02/2020, 11:04 PMUgi
10/03/2020, 5:06 PMclass Scope {
fun String.appendSomething() = this + "something"
}
fun scopedExtensions(body : Scope.() -> Unit) {
body.invoke(Scope())
}
fun test() {
scopedExtensions {
"Test".appendSomething() // Compiler is ok with this
}
"Bla".appendSomething() // Compiler complains here
}