[NI] Don't complete nested call if there's no constraints at all

This commit is contained in:
Mikhail Zarechenskiy
2019-03-25 10:20:39 +03:00
parent 9825984bc5
commit ca894a6a71
27 changed files with 84 additions and 77 deletions
@@ -8,6 +8,6 @@ fun foo(): String {
}
fun bar(): String {
val x = fn() ?: return ""
<!NI;UNREACHABLE_CODE, OI;UNREACHABLE_CODE!>val <!NI;UNUSED_VARIABLE, OI;UNUSED_VARIABLE!>y<!> =<!> x<!UNNECESSARY_SAFE_CALL!>?.<!>let { throw Exception() } <!NI;UNREACHABLE_CODE, NI;USELESS_ELVIS, OI;UNREACHABLE_CODE, OI;USELESS_ELVIS!>?: "unreachable"<!>
<!NI;UNREACHABLE_CODE, OI;UNREACHABLE_CODE!>return y<!>
<!OI;UNREACHABLE_CODE!>val <!OI;UNUSED_VARIABLE!>y<!> =<!> x<!UNNECESSARY_SAFE_CALL!>?.<!>let { throw Exception() } <!OI;UNREACHABLE_CODE, OI;USELESS_ELVIS!>?: "unreachable"<!>
<!OI;UNREACHABLE_CODE!>return y<!>
}