Fix tests in DiagnosticsTestWithStdLibGenerated with NI

This commit is contained in:
Dmitriy Novozhilov
2019-01-30 13:08:22 +03:00
parent 98810ba750
commit 0501a108c0
73 changed files with 507 additions and 218 deletions
@@ -1,3 +1,4 @@
// !WITH_NEW_INFERENCE
// !IGNORE_DATA_FLOW_IN_ASSERT
// SKIP_TXT
// WITH_RUNTIME
@@ -10,11 +11,11 @@ class B: A {
fun test1(a: A) {
assert((a as B).bool())
a.<!UNRESOLVED_REFERENCE!>bool<!>()
<!NI;DEBUG_INFO_SMARTCAST!>a<!>.<!OI;UNRESOLVED_REFERENCE!>bool<!>()
}
fun test2() {
val a: A? = null;
assert((a as B).bool())
a?.<!UNRESOLVED_REFERENCE!>bool<!>()
<!NI;DEBUG_INFO_SMARTCAST!>a<!><!NI;UNNECESSARY_SAFE_CALL!>?.<!><!OI;UNRESOLVED_REFERENCE!>bool<!>()
}
@@ -1,37 +1,38 @@
// !WITH_NEW_INFERENCE
// !IGNORE_DATA_FLOW_IN_ASSERT
// SKIP_TXT
// WITH_RUNTIME
fun test1(s: String?) {
assert(s!!.isEmpty())
s?.length
s<!NI;UNNECESSARY_SAFE_CALL!>?.<!>length
}
fun test2(s: String?) {
assert(s!!.isEmpty())
s!!.length
s<!NI;UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>.length
}
fun test3(s: String?) {
assert(s!!.isEmpty())
s<!UNSAFE_CALL!>.<!>length
<!NI;DEBUG_INFO_SMARTCAST!>s<!><!OI;UNSAFE_CALL!>.<!>length
}
fun test4() {
val s: String? = null;
assert(s!!.isEmpty())
s?.length
s<!NI;UNNECESSARY_SAFE_CALL!>?.<!>length
}
fun test5() {
val s: String? = null;
assert(s!!.isEmpty())
s!!.length
s<!NI;UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>.length
}
fun test6() {
val s: String? = null;
assert(s!!.isEmpty())
s<!UNSAFE_CALL!>.<!>length
<!NI;DEBUG_INFO_SMARTCAST!>s<!><!OI;UNSAFE_CALL!>.<!>length
}