Files
kotlin-fork/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/resultAny.kt
T
Ivan Kylchik c7435ba760 Replace all occurrences of WITH_RUNTIME with WITH_STDLIB
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.
2021-11-17 15:26:38 +03:00

21 lines
520 B
Kotlin
Vendored

// WITH_STDLIB
@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE")
@kotlin.jvm.JvmInline
value class IC(val value: Any)
fun <T> foo(a: Result<T>, ic: IC): Pair<T, Any> = bar(a, ic) { a, ic ->
a.getOrThrow() to ic.value
}
fun interface FunIFace<T1, T2, R> {
fun call(t1: T1, t2: T2): R
}
fun <T1, T2, R> bar(t1: T1, t2: T2, f: FunIFace<T1, T2, R>): R {
return f.call(t1, t2)
}
fun Pair<Any, Any>.join(): String = "$first$second"
fun box(): String = foo<Any>(Result.success("O"), IC("K")).join()