Fixed EA-57220.

This commit is contained in:
Evgeny Gerashchenko
2014-10-10 23:17:42 +04:00
parent b653598df2
commit fbcfed6757
7 changed files with 35 additions and 2 deletions
@@ -0,0 +1,8 @@
// "Replace 'if' expression with elvis expression" "true"
data class IntPair(val first: Int?, val second: Int?)
fun f(pair: IntPair): Int {
val (x, y) = pair
return if (x != <caret>null) x else 5
}
@@ -0,0 +1,8 @@
// "Replace 'if' expression with elvis expression" "true"
data class IntPair(val first: Int?, val second: Int?)
fun f(pair: IntPair): Int {
val (x, y) = pair
return x ?: 5
}
@@ -79,6 +79,14 @@
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">If-Then foldable to '?:'.</problem_class>
<description>Replace 'if' expression with elvis expression</description>
</problem>
<problem>
<file>doesNotInlineVariableInMultiDeclaration.kt</file>
<line>7</line>
<module>light_idea_test_case</module>
<entry_point TYPE="file" FQNAME="temp:///src/src/doesNotInlineVariableInMultiDeclaration.kt" />
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">If-Then foldable to '?:'.</problem_class>
<description>Replace 'if' expression with elvis expression</description>
</problem>
<problem>
<file>doesNotinlineValueIfUsedMoreThanOnce.kt</file>
<line>11</line>