Files
kotlin-fork/compiler/testData/diagnostics/tests/inference/regressions/kt2842.kt
T
Mikhael Bogdanov d11311ec20 Test compilation fix
2013-12-02 18:30:42 +04:00

27 lines
548 B
Kotlin

package c
trait A<T>
fun test(a: A<Int>?) {
a<!UNSAFE_CALL!>.<!>foo() //no error
}
fun <R> A<R>.foo() {}
//------------
fun test(nullabilityInfoMap: Map<Int, Any>?) {
nullabilityInfoMap<!UNSAFE_CALL!>.<!>iterator() //no error
}
//resolves to
public fun <K,V> Map<K,V>.iterator(): Iterator<Map.Entry<K,V>> {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
//-------------
fun foo() : Boolean {
val nullableList = getNullableList()
return nullableList<!UNSAFE_CALL!>.<!>contains("")
}
fun getNullableList(): List<String>? = null