Revert "FoldInitializerAndIfToElvisInspection: don't add explicit type if var is used as non-nullable"

This reverts commit bb7d4c22
This commit is contained in:
Yan Zhulanow
2020-10-24 00:22:18 +09:00
parent 87574dddd9
commit c07f25fa44
5 changed files with 12 additions and 26 deletions
@@ -1,3 +1,4 @@
// PROBLEM: none
fun test(foo: Int?, bar: Int): Int {
var i = foo
<caret>if (i == null) {
@@ -1,4 +0,0 @@
fun test(foo: Int?, bar: Int): Int {
var i = foo ?: return bar
return i
}
@@ -1,3 +1,4 @@
// PROBLEM: none
fun test(foo: Int?, bar: Int): Int {
var i = foo
<caret>if (i == null) {
@@ -1,8 +0,0 @@
fun test(foo: Int?, bar: Int): Int {
var i = foo ?: return bar
baz(i)
val j = i + 1
return j
}
fun baz(i: Int?) {}