Inspection (and quickfix) for extension propeties conflicting with synthetic ones

This commit is contained in:
Valentin Kipyatkov
2015-08-31 19:08:01 +03:00
parent d41e01c0e4
commit 10f7d6d7dd
45 changed files with 620 additions and 16 deletions
@@ -0,0 +1,16 @@
import java.io.File
import java.io.Serializable
val File.name: String
get() = getName()
val Serializable.name: String
get() = ""
val File.parent: File
get() = getParentFile()
class MyFile : File("")
val MyFile.isFile: Boolean
get() = isFile()
@@ -0,0 +1,28 @@
<problems>
<problem>
<file>File.kt</file>
<line>4</line>
<module>light_idea_test_case</module>
<entry_point TYPE="file" FQNAME="File.kt" />
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Extension property conflicts with automatically produced one</problem_class>
<description>This property conflicts with synthetic extension and should be removed to avoid breaking code by future changes in the compiler</description>
</problem>
<problem>
<file>File.kt</file>
<line>10</line>
<module>light_idea_test_case</module>
<entry_point TYPE="file" FQNAME="File.kt" />
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Extension property conflicts with automatically produced one</problem_class>
<description>This property conflicts with synthetic extension and should be removed to avoid breaking code by future changes in the compiler</description>
</problem>
<problem>
<file>File.kt</file>
<line>15</line>
<module>light_idea_test_case</module>
<entry_point TYPE="file" FQNAME="File.kt" />
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Extension property conflicts with automatically produced one</problem_class>
<description>This property conflicts with synthetic extension and should be removed to avoid breaking code by future changes in the compiler</description>
</problem>
</problems>
@@ -0,0 +1 @@
// INSPECTION_CLASS: org.jetbrains.kotlin.idea.inspections.ConflictingExtensionPropertyInspection