Implement kotlin.jvm.overloads annotation for generating all overloads of a method that has default parameter values.
#KT-2095 Fixed
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
class C {
|
||||
[kotlin.jvm.overloads] public fun foo(o: String = "O", k: String = "K"): String {
|
||||
return o + k
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val c = C()
|
||||
val m = c.javaClass.getMethod("foo")
|
||||
return m.invoke(c) as String
|
||||
}
|
||||
Reference in New Issue
Block a user