Destructure intention: entries / entrySet are now removed only for kotlin.Map inheritors #KT-14244 Fixed

This commit is contained in:
Mikhail Glukhikh
2016-10-07 19:46:28 +03:00
parent 304f6a3b3a
commit 8188bb1e54
5 changed files with 46 additions and 4 deletions
@@ -0,0 +1,11 @@
// WITH_RUNTIME
class MyMap {
val entries = listOf<Map.Entry<Int, Int>>()
}
fun foo(mm: MyMap) {
for (entry<caret> in mm.entries) {
val (key, value) = entry
}
}
@@ -0,0 +1,10 @@
// WITH_RUNTIME
class MyMap {
val entries = listOf<Map.Entry<Int, Int>>()
}
fun foo(mm: MyMap) {
for ((key, value) in mm.entries) {
}
}
@@ -231,4 +231,12 @@
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Use destructuring declaration</problem_class>
<description>Use destructuring declaration</description>
</problem>
<problem>
<file>FakeEntries.kt</file>
<line>8</line>
<module>light_idea_test_case</module>
<entry_point TYPE="file" FQNAME="temp:///src/FakeEntries.kt" />
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Use destructuring declaration</problem_class>
<description>Use destructuring declaration</description>
</problem>
</problems>