Files
kotlin-fork/compiler/testData/diagnostics/tests/nullabilityAndAutoCasts/smartCastedReceiverWithGenerics.kt
T
Svetlana Isakova 4b89c22ba7 Check separately auto casts for nullable types.
It's necessary for functions with generics: constraint system ignores nullability divergence,
the error checks are made afterwards, the auto cast check should be made similarly.
2013-12-11 19:53:51 +04:00

7 lines
119 B
Kotlin

fun test(a: Any?) {
if (a != null) {
<!DEBUG_INFO_AUTOCAST!>a<!>.foo(11)
}
}
fun <T> Any.foo(t: T) = t