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,27 +1,29 @@
// !CHECK_TYPE
//KT-2176 non-nullability is not inferred after !! or "as"
package kt2176
fun f1(a: String?) {
a!!
<!DEBUG_INFO_SMARTCAST!>a<!>: String
checkSubtype<String>(<!DEBUG_INFO_SMARTCAST!>a<!>)
}
fun f2(a: String) {
a<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>
a: String
checkSubtype<String>(a)
}
fun f3(a: Any?) {
a as String
<!DEBUG_INFO_SMARTCAST!>a<!>: String
checkSubtype<String>(<!DEBUG_INFO_SMARTCAST!>a<!>)
}
fun f4(a: Any) {
a as String
<!DEBUG_INFO_SMARTCAST!>a<!>: String
checkSubtype<String>(<!DEBUG_INFO_SMARTCAST!>a<!>)
}
fun f5(a: String) {
a <!USELESS_CAST_STATIC_ASSERT_IS_FINE!>as Any?<!>
a: String
a <!USELESS_CAST!>as Any?<!>
checkSubtype<String>(a)
}