Inspection (and quickfix) for extension propeties conflicting with synthetic ones
This commit is contained in:
@@ -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()
|
||||
+28
@@ -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>
|
||||
+1
@@ -0,0 +1 @@
|
||||
// INSPECTION_CLASS: org.jetbrains.kotlin.idea.inspections.ConflictingExtensionPropertyInspection
|
||||
Reference in New Issue
Block a user