Inspection checking that destructuring variable name matches the name of different component #KT-12004 Fixed

This commit is contained in:
Kirill Rakhman
2017-02-17 17:53:44 +01:00
committed by Mikhail Glukhikh
parent af7de9a0c5
commit 2506bb6673
7 changed files with 100 additions and 0 deletions
@@ -0,0 +1,12 @@
<problems>
<problem>
<file>test.kt</file>
<line>4</line>
<module>light_idea_test_case</module>
<entry_point TYPE="file" FQNAME="temp:///src/test.kt"/>
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Variable in destructuring declaration uses name of a wrong data
class property
</problem_class>
<description>Variable name 'c' matches the name of a different component</description>
</problem>
</problems>
@@ -0,0 +1 @@
// INSPECTION_CLASS: org.jetbrains.kotlin.idea.inspections.DestructuringWrongNameInspection
@@ -0,0 +1,5 @@
data class Foo(val a: String, val b: Int, val c: String)
fun bar(f: Foo) {
val (a, c) = f
}