spierce7
08/08/2019, 5:25 PMobject Example {
fun String.exampleExtension() {
}
}
fun test(str: String) {
str.exampleExtension() // Doesn't work. How can I use the extension function?
}Shawn
08/08/2019, 5:27 PMwith(Example) {
str.exampleExtension()
}Shawn
08/08/2019, 5:27 PMExample to any function that takes T.() -> * will work, like applyShawn
08/08/2019, 5:28 PMShawn
08/08/2019, 5:28 PMspierce7
08/08/2019, 5:44 PM