https://kotlinlang.org logo
b

benleggiero

03/08/2017, 12:02 AM
it should be possible to add static extension functions to external classes that have no companion object (like Java objects). Use case:
Copy code
fun java.awt.Color.Companion.fromHex(hexString: String): Color {
    ...
}

...

val c = Color.fromHex("#123456")
1 reply https://youtrack.jetbrains.com/issue/KT-16729