Ayfri
03/04/2022, 12:32 AMandylamax
03/04/2022, 12:37 AMTim Oltjenbruns
03/04/2022, 12:43 AMAyfri
03/04/2022, 12:45 AMOverriding `external` function with optional parameters
ephemient
03/04/2022, 1:52 AMturansky
03/04/2022, 6:49 AM// TS
draw(
x?: number,
y?: number,
)
// Kotlin
fun draw(
x: Double? = definedExternally,
y: Double? = definedExternally,
)
It’s even more transparent when you override method with optional parameters (your case)
@file:Suppress("OVERRIDING_EXTERNAL_FUN_WITH_OPTIONAL_PARAMS")
...
override fun draw(
x: Double?,
y: Double?,
) {
// job
}
cc @Sergei Grishchenkohfhbd
03/04/2022, 8:33 AMAyfri
03/04/2022, 11:12 AM