c7435ba760
We are going to deprecate `WITH_RUNTIME` directive. The main reason behind this change is that `WITH_STDLIB` directive better describes its meaning, specifically it will add kotlin stdlib to test's classpath.
22 lines
433 B
Kotlin
Vendored
22 lines
433 B
Kotlin
Vendored
// WITH_STDLIB
|
|
// WITH_REFLECT
|
|
|
|
import kotlin.test.assertEquals
|
|
|
|
fun foo(x: Int?) {}
|
|
fun foo(y: String?) {}
|
|
fun foo(z: Boolean) {}
|
|
|
|
inline fun <reified T> bar(f: (T) -> Unit, tType: String): T? {
|
|
assertEquals(tType, T::class.simpleName)
|
|
return null
|
|
}
|
|
|
|
fun box(): String {
|
|
val a1: Int? = bar(::foo, "Int")
|
|
val a2: String? = bar(::foo, "String")
|
|
val a3: Boolean? = bar<Boolean>(::foo, "Boolean")
|
|
|
|
return "OK"
|
|
}
|