Files
kotlin-fork/compiler/testData/diagnostics/tests/inference/commonSystem/exactOnElvis.kt
T
Denis.Zharkov 883b18a0c6 FIR: Preserve non-custom attributes after substitution
The test is being fixed since synthetic call for elvis has @Exact-attribute on return type
2021-11-26 19:39:45 +03:00

30 lines
672 B
Kotlin
Vendored

// FIR_IDENTICAL
// SKIP_TXT
interface SelectBuilder<in X> {
fun foo(block: () -> X)
}
fun <R> select1(builder: SelectBuilder<R>.() -> Unit): R = TODO()
fun <F> select2(builder: SelectBuilder<F>.() -> Unit): F = TODO()
fun <Q> myRun(builder: () -> Q): Q = TODO()
fun <H> bar(w1: H?, w2: H?) {
val h1: H = myRun {
select1 {
foo { w1 }
} ?: select2 {
foo { w2 }
} ?: throw RuntimeException()
}
val h2: H = try {
select1 {
foo { w1 }
} ?: select2 {
foo { w2 }
} ?: throw RuntimeException()
} catch (t: Throwable) {
throw RuntimeException()
}
}