Files
kotlin-fork/compiler/testData/diagnostics/tests/inference/regressions/kt3174.kt
T
2012-12-26 16:43:59 +04:00

12 lines
276 B
Kotlin

//KT-3174 Call resolver doesn't understand type is not-nullable after ?. safe call
package a
fun <T: Any> T.test(): T = this
fun foo(a: Any?) = a?.test() // Error
fun <T> T.fff(l: MutableList<T>) = l.add(this)
fun test(s: String?, l: MutableList<String>) {
s?.fff(l)
}