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,16 +1,18 @@
// !CHECK_TYPE
fun test(bal: Array<Int>) {
var bar = 4
val a = { bar += 4 }
a : () -> Unit
checkSubtype<() -> Unit>(a)
val b = { bar = 4 }
b : () -> Unit
checkSubtype<() -> Unit>(b)
val c = { bal[2] = 3 }
c : () -> Unit
checkSubtype<() -> Unit>(c)
val d = run { bar += 4 }
d : Unit
checkSubtype<Unit>(d)
}
fun <T> run(f: () -> T): T = f()