Files
kotlin-fork/compiler/testData/diagnostics/tests/regressions/kt743.kt
T

8 lines
229 B
Kotlin

//KT-743 Wrong type inference
class List<T>(val head: T, val tail: List<T>? = null)
fun <T : Any> T?.sure() : T = this!!
fun <T, Q> List<T>.map(f: (T)-> Q): List<T>? = tail.sure<List<T>>().map(f)
fun foo<T>(t : T) : T = foo(t)