Use "if-then to" even for 'if (arg != null) arg' removing 'if'
This commit is contained in:
+8
@@ -135,4 +135,12 @@
|
||||
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">If-Then foldable to '?.'</problem_class>
|
||||
<description>Replace 'if' expression with safe cast expression</description>
|
||||
</problem>
|
||||
<problem>
|
||||
<file>nullCheckSimple.kt</file>
|
||||
<line>2</line>
|
||||
<module>light_idea_test_case</module>
|
||||
<entry_point TYPE="file" FQNAME="temp:///src/nullCheckSimple.kt" />
|
||||
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">If-Then foldable to '?.'</problem_class>
|
||||
<description>Remove redundant 'if' expression</description>
|
||||
</problem>
|
||||
</problems>
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
// IS_APPLICABLE: false
|
||||
|
||||
fun foo(arg: Any?): Any? {
|
||||
return if (<caret>arg != null) arg else null
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fun foo(arg: Any?): Any? {
|
||||
return arg
|
||||
}
|
||||
Reference in New Issue
Block a user