Join Slack
Communities
Powered by
Thoughts on making @JvmOverloads usable on interfa...
# language-proposals
n
Nick Johnson
06/09/2019, 1:34 AM
Thoughts on making @JvmOverloads usable on interfaces? This has no major impact itself on Kotlin, but rather makes default parameters for methods better for Java. This is an issue that arises because interfaces can have methods fully implemented. The default parameters can be used in kotlin, but in java, the normally default parameters must be specified. This is an issue for my library
https://github.com/kotlin-graphics/imgui
, as the core object (see
https://github.com/kotlin-graphics/imgui/blob/master/imgui-core/src/main/kotlin/imgui/imgui.kt#L66
) uses many interfaces to implement the actual behavior. The switch to classes would not be feasible, since classes can only extend one other class. an example of a method which would benefit from this is seen here:
https://github.com/kotlin-graphics/imgui/blob/master/imgui-core/src/main/kotlin/imgui/imgui/menus.kt#L324
👍 1
Open in Slack
Previous
Next