deprecating types after colon

This commit is contained in:
Dmitry Jemerov
2015-04-21 18:32:31 +02:00
parent b7a4b3c17d
commit f374eec8f1
268 changed files with 1055 additions and 769 deletions
@@ -1,3 +1,5 @@
// !CHECK_TYPE
//KT-2324 Can't resolve generic by type of function result
package i
@@ -13,11 +15,11 @@ fun <T, K> someFunction(list: List<T>, transform: (T) -> K): List<K> {
}
fun testSomeFunction() {
val result1 = someFunction(arrayList<Int>(1, 2), {it : Int}) //type of result1 is List<Int>
val result1 = someFunction(arrayList<Int>(1, 2), {checkSubtype<Int>(it)}) //type of result1 is List<Int>
assertEquals(1, result1.get(0)); //OK
val result2 = someFunction(arrayList<Int>(1, 2), {it}) // type of result2 is List<DONT_CARE>
result2 : List<Int>
checkSubtype<List<Int>>(result2)
assertEquals(1, result2.get(0)); //resolved to error element
}