"If null to elvis" now converts to elvis also !is check right after initializer #KT-14032 Fixed
This commit is contained in:
committed by
Mikhail Glukhikh
parent
121f0ec810
commit
0903402282
@@ -1,4 +1,4 @@
|
||||
// "Suppress 'IfNullToElvis' for fun foo" "true"
|
||||
// "Suppress 'FoldInitializerAndIfToElvis' for fun foo" "true"
|
||||
|
||||
fun foo(p: List<String?>, b: Boolean) {
|
||||
var v = p[0]
|
||||
@@ -6,4 +6,4 @@ fun foo(p: List<String?>, b: Boolean) {
|
||||
if (b) v = null
|
||||
}
|
||||
|
||||
// TOOL: org.jetbrains.kotlin.idea.intentions.IfNullToElvisInspection
|
||||
// TOOL: org.jetbrains.kotlin.idea.intentions.FoldInitializerAndIfToElvisInspection
|
||||
@@ -1,10 +1,10 @@
|
||||
// "Suppress 'IfNullToElvis' for fun foo" "true"
|
||||
// "Suppress 'FoldInitializerAndIfToElvis' for fun foo" "true"
|
||||
|
||||
@Suppress("IfNullToElvis")
|
||||
@Suppress("FoldInitializerAndIfToElvis")
|
||||
fun foo(p: List<String?>, b: Boolean) {
|
||||
var v = p[0]
|
||||
<caret>if (v == null) return
|
||||
if (b) v = null
|
||||
}
|
||||
|
||||
// TOOL: org.jetbrains.kotlin.idea.intentions.IfNullToElvisInspection
|
||||
// TOOL: org.jetbrains.kotlin.idea.intentions.FoldInitializerAndIfToElvisInspection
|
||||
Reference in New Issue
Block a user