Simplify for intention: apply name validator to prevent conflicts
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
data class XY(val x: Int, val y: Int)
|
||||
|
||||
fun foo(list: List<XY>) {
|
||||
val y = list.size
|
||||
for (<caret>element in list) {
|
||||
val x = element.x + element.y
|
||||
println(x)
|
||||
println(y)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
data class XY(val x: Int, val y: Int)
|
||||
|
||||
fun foo(list: List<XY>) {
|
||||
val y = list.size
|
||||
for ((x1, y1) in list) {
|
||||
val x = x1 + y1
|
||||
println(x)
|
||||
println(y)
|
||||
}
|
||||
}
|
||||
@@ -167,4 +167,12 @@
|
||||
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">'for' that can be simplified using destructing declaration</problem_class>
|
||||
<description>Simplify 'for' using destructing declaration</description>
|
||||
</problem>
|
||||
<problem>
|
||||
<file>DataClassNameConflict.kt</file>
|
||||
<line>7</line>
|
||||
<module>light_idea_test_case</module>
|
||||
<entry_point TYPE="file" FQNAME="temp:///src/DataClassNameConflict.kt" />
|
||||
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">'for' that can be simplified using destructing declaration</problem_class>
|
||||
<description>Simplify 'for' using destructing declaration</description>
|
||||
</problem>
|
||||
</problems>
|
||||
Reference in New Issue
Block a user