Files
kotlin/compiler/testData/codegen/boxWithStdlib/reflection/callBy/defaultAndNonDefaultIntertwined.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

16 lines
333 B
Kotlin
Vendored

import kotlin.test.assertEquals
fun foo(a: String, b: String = "b", c: String, d: String = "d", e: String) =
a + b + c + d + e
fun box(): String {
val p = ::foo.parameters
assertEquals("abcde", ::foo.callBy(mapOf(
p[0] to "a",
p[2] to "c",
p[4] to "e"
)))
return "OK"
}