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
public fun foo(x: String?): Int {
var y: Any
loop@ while (true) {
@@ -8,7 +10,7 @@ public fun foo(x: String?): Int {
else -> <!DEBUG_INFO_SMARTCAST!>x<!>.length()
}
// y is always Int after when
<!DEBUG_INFO_SMARTCAST!>y<!>: Int
checkSubtype<Int>(<!DEBUG_INFO_SMARTCAST!>y<!>)
}
// x is null because of the break
return x<!UNSAFE_CALL!>.<!>length()
@@ -1,3 +1,5 @@
// !CHECK_TYPE
fun bar(): Boolean { return true }
public fun foo(x: String?): Int {
@@ -11,10 +13,10 @@ public fun foo(x: String?): Int {
else -> <!DEBUG_INFO_SMARTCAST!>x<!>.length()
}
// y is always Int after when
<!DEBUG_INFO_SMARTCAST!>y<!>: Int
checkSubtype<Int>(<!DEBUG_INFO_SMARTCAST!>y<!>)
} while (bar())
// y is always Int even here
<!DEBUG_INFO_SMARTCAST!>y<!>: Int
checkSubtype<Int>(<!DEBUG_INFO_SMARTCAST!>y<!>)
// x is null because of the break
return x<!UNSAFE_CALL!>.<!>length()
}