Files
kotlin-fork/compiler/testData/diagnostics/tests/inference/regressions/kt32250.kt
T
Dmitriy Novozhilov 5f9f01fe4e [FIR] Implement new completion mode calculator
Note that `testDelegates` now fails due to KT-37638 and
    `testSimpleIn` fails due to problems with type parameters
    of inner classes
2020-03-20 23:11:28 +03:00

32 lines
519 B
Kotlin
Vendored

// FIR_IDENTICAL
// !LANGUAGE: +NewInference
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE
interface I {
fun foo()
}
data class Pair<X, Y>(val fst: X, val snd: Y)
class A(f: Pair<Int, (I) -> Unit>? = null)
class B(f: ((I) -> Unit)? = null)
fun main() {
val cond = true
A(
if (cond) {
Pair(1, { baz -> baz.foo() })
} else {
null
}
)
B(
if (cond) {
{ baz -> baz.foo() }
} else {
null
}
)
}