deprecating types after colon
This commit is contained in:
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user