Files
kotlin-fork/compiler/testData/diagnostics/tests/generics/nullability/notNullSmartcastOnIntersectionOfNullables.kt
T
2018-12-11 11:29:59 +03:00

18 lines
292 B
Kotlin
Vendored

// !LANGUAGE: +NewInference
// !DIAGNOSTICS: -UNUSED_PARAMETER
interface A
interface B {
fun test() {}
}
fun <K> select(a: K, b: K): K = a
fun test(a: A?, b: B?) {
b as A?
a as B?
val c = select(a, b)
if (c != null) {
<!DEBUG_INFO_SMARTCAST!>c<!>.test()
}
}