"Redundant 'requireNotNull' or 'checkNotNull' call": don't remove first argument if function is used as expression

#KT-31404 Fixed
This commit is contained in:
Toshiaki Kameyama
2019-05-13 13:15:10 +09:00
committed by Dmitry Gridin
parent 574178882a
commit cf4471ba53
8 changed files with 47 additions and 2 deletions
@@ -0,0 +1,4 @@
// WITH_RUNTIME
fun test(i: Int) {
val a = <caret>requireNotNull(i)
}
@@ -0,0 +1,4 @@
// WITH_RUNTIME
fun test(i: Int) {
val a = i
}
@@ -0,0 +1,4 @@
// WITH_RUNTIME
fun test(i: Int) {
println(<caret>requireNotNull(i) { "" })
}
@@ -0,0 +1,4 @@
// WITH_RUNTIME
fun test(i: Int) {
println(i)
}
@@ -0,0 +1,4 @@
// WITH_RUNTIME
fun test(i: Int) {
"${<caret>checkNotNull(i)}"
}
@@ -0,0 +1,4 @@
// WITH_RUNTIME
fun test(i: Int) {
"${i}"
}