Foldable if-then: do not highlight for is checks #KT-24978 Fixed
This commit is contained in:
committed by
Mikhail Glukhikh
parent
ac14c5e74f
commit
bae754a266
-40
@@ -95,22 +95,6 @@
|
||||
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">If-Then foldable to '?.'</problem_class>
|
||||
<description>Foldable if-then</description>
|
||||
</problem>
|
||||
<problem>
|
||||
<file>isCondition.kt</file>
|
||||
<line>1</line>
|
||||
<module>light_idea_test_case</module>
|
||||
<entry_point TYPE="file" FQNAME="temp:///src/src/isCondition.kt" />
|
||||
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">If-Then foldable to '?.'</problem_class>
|
||||
<description>Foldable if-then</description>
|
||||
</problem>
|
||||
<problem>
|
||||
<file>isNotCondition.kt</file>
|
||||
<line>1</line>
|
||||
<module>light_idea_test_case</module>
|
||||
<entry_point TYPE="file" FQNAME="temp:///src/src/isNotCondition.kt" />
|
||||
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">If-Then foldable to '?.'</problem_class>
|
||||
<description>Foldable if-then</description>
|
||||
</problem>
|
||||
<problem>
|
||||
<file>nullCheckWithSelectorCallChain.kt</file>
|
||||
<line>5</line>
|
||||
@@ -119,22 +103,6 @@
|
||||
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">If-Then foldable to '?.'</problem_class>
|
||||
<description>Foldable if-then</description>
|
||||
</problem>
|
||||
<problem>
|
||||
<file>isCheckWithSelectorChain.kt</file>
|
||||
<line>4</line>
|
||||
<module>light_idea_test_case</module>
|
||||
<entry_point TYPE="file" FQNAME="temp:///src/isCheckWithSelectorChain.kt" />
|
||||
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">If-Then foldable to '?.'</problem_class>
|
||||
<description>Foldable if-then</description>
|
||||
</problem>
|
||||
<problem>
|
||||
<file>isCheckSimple.kt</file>
|
||||
<line>4</line>
|
||||
<module>light_idea_test_case</module>
|
||||
<entry_point TYPE="file" FQNAME="temp:///src/isCheckSimple.kt" />
|
||||
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">If-Then foldable to '?.'</problem_class>
|
||||
<description>Foldable if-then</description>
|
||||
</problem>
|
||||
<problem>
|
||||
<file>nullCheckSimple.kt</file>
|
||||
<line>2</line>
|
||||
@@ -151,14 +119,6 @@
|
||||
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">If-Then foldable to '?.'</problem_class>
|
||||
<description>Foldable if-then</description>
|
||||
</problem>
|
||||
<problem>
|
||||
<file>property.kt</file>
|
||||
<line>10</line>
|
||||
<module>light_idea_test_case</module>
|
||||
<entry_point TYPE="file" FQNAME="temp:///src/property.kt" />
|
||||
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">If-Then foldable to '?.'</problem_class>
|
||||
<description>Foldable if-then</description>
|
||||
</problem>
|
||||
<problem>
|
||||
<file>propertyNotNull.kt</file>
|
||||
<line>9</line>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// HIGHLIGHT: INFORMATION
|
||||
class My(val x: Int)
|
||||
|
||||
fun foo(arg: Any?): My? {
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// HIGHLIGHT: INFORMATION
|
||||
class My(val x: Int)
|
||||
|
||||
fun foo(arg: Any?): My? {
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// HIGHLIGHT: INFORMATION
|
||||
class My(val x: Int)
|
||||
|
||||
fun foo(arg: Any?): Int? {
|
||||
|
||||
Vendored
+1
@@ -1,3 +1,4 @@
|
||||
// HIGHLIGHT: INFORMATION
|
||||
class My(val x: Int)
|
||||
|
||||
fun foo(arg: Any?): Int? {
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
// HIGHLIGHT: INFORMATION
|
||||
fun foo(arg: Any) = <caret>if (arg is String) arg.length else null
|
||||
+1
@@ -1 +1,2 @@
|
||||
// HIGHLIGHT: INFORMATION
|
||||
fun foo(arg: Any) = (arg as? String)?.length
|
||||
@@ -1 +1,2 @@
|
||||
// HIGHLIGHT: INFORMATION
|
||||
fun foo(arg: Any) = <caret>if (arg !is String) null else arg.length
|
||||
+1
@@ -1 +1,2 @@
|
||||
// HIGHLIGHT: INFORMATION
|
||||
fun foo(arg: Any) = (arg as? String)?.length
|
||||
@@ -1,4 +1,4 @@
|
||||
|
||||
// HIGHLIGHT: INFORMATION
|
||||
// FIX: Replace 'if' expression with safe cast expression
|
||||
|
||||
interface Foo
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
|
||||
// HIGHLIGHT: INFORMATION
|
||||
// FIX: Replace 'if' expression with safe cast expression
|
||||
|
||||
interface Foo
|
||||
|
||||
Reference in New Issue
Block a user