Files
kotlin/compiler/testData/codegen/boxWithStdlib/reflection/callBy/extensionFunction.kt
Alexander Udalov 593937d302 Support KCallable.callBy with map of parameters to arguments
callBy is able to handle optional parameters.

 #KT-8827 Fixed
2015-08-29 18:37:40 +03:00

10 lines
216 B
Kotlin
Vendored

import kotlin.test.assertEquals
fun String.sum(other: String = "b") = this + other
fun box(): String {
val f = String::sum
assertEquals("ab", f.callBy(mapOf(f.parameters.first() to "a")))
return "OK"
}