KT-743 Wrong type inference

This commit is contained in:
Andrey Breslav
2011-12-08 19:17:31 +04:00
parent a0cd4af3bd
commit 22e1412c38
6 changed files with 89 additions and 53 deletions
@@ -0,0 +1,6 @@
//KT-743 Wrong type inference
// +JDK
class List<T>(val head: T, val tail: List<T>? = null)
fun <T, Q> List<T>.map(f: fun(T): Q): List<T>? = tail.sure<List<T>>().map(f)
fun foo<T>(t : T) : T = foo(t)