[FE] Fix positioning strategy for SAFE_CALL_WILL_CHANGE_NULLABILITY warning

^KT-46860
This commit is contained in:
Dmitriy Novozhilov
2022-03-28 11:28:08 +04:00
committed by teamcity
parent 565c61a702
commit 078acb1bfe
16 changed files with 127 additions and 7 deletions
@@ -8,6 +8,6 @@ fun foo(): String {
}
fun bar(): String {
val x = fn() ?: return ""
<!UNREACHABLE_CODE!>val <!UNUSED_VARIABLE!>y<!> =<!> <!SAFE_CALL_WILL_CHANGE_NULLABILITY!>x<!UNNECESSARY_SAFE_CALL!>?.<!>let { throw Exception() }<!> <!UNREACHABLE_CODE, USELESS_ELVIS!>?: "unreachable"<!>
<!UNREACHABLE_CODE!>val <!UNUSED_VARIABLE!>y<!> =<!> x<!SAFE_CALL_WILL_CHANGE_NULLABILITY!><!UNNECESSARY_SAFE_CALL!>?.<!>let { throw Exception() }<!> <!UNREACHABLE_CODE, USELESS_ELVIS!>?: "unreachable"<!>
<!UNREACHABLE_CODE!>return y<!>
}