Inspection checking that destructuring variable name matches the name of different component #KT-12004 Fixed
This commit is contained in:
committed by
Mikhail Glukhikh
parent
af7de9a0c5
commit
2506bb6673
@@ -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>
|
||||
+1
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user