KT-9839 related, secondary constructor to primary: inspection for the single constructor
(cherry picked from commit aec0090)
This commit is contained in:
committed by
Mikhail Glukhikh
parent
3508bea391
commit
0a4542c6c0
+10
@@ -0,0 +1,10 @@
|
||||
<problems>
|
||||
<problem>
|
||||
<file>test.kt</file>
|
||||
<line>5</line>
|
||||
<module>light_idea_test_case</module>
|
||||
<entry_point TYPE="file" FQNAME="temp:///src/test.kt" />
|
||||
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Convert to primary constructor</problem_class>
|
||||
<description>Convert to primary constructor</description>
|
||||
</problem>
|
||||
</problems>
|
||||
+1
@@ -0,0 +1 @@
|
||||
// INSPECTION_CLASS: org.jetbrains.kotlin.idea.intentions.ConvertSecondaryConstructorToPrimaryInspection
|
||||
@@ -0,0 +1,19 @@
|
||||
class Single {
|
||||
|
||||
val x: Int
|
||||
|
||||
constructor(x: Int) {
|
||||
this.x = x
|
||||
}
|
||||
}
|
||||
|
||||
class NotSingle {
|
||||
|
||||
val x: Int
|
||||
|
||||
constructor(): this(42)
|
||||
|
||||
constructor(x: Int) {
|
||||
this.x = x
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user