diff --git a/idea/src/org/jetbrains/kotlin/idea/intentions/ConvertPrimaryConstructorToSecondaryIntention.kt b/idea/src/org/jetbrains/kotlin/idea/intentions/ConvertPrimaryConstructorToSecondaryIntention.kt index 7bee90517c2..6d2042c5a7c 100644 --- a/idea/src/org/jetbrains/kotlin/idea/intentions/ConvertPrimaryConstructorToSecondaryIntention.kt +++ b/idea/src/org/jetbrains/kotlin/idea/intentions/ConvertPrimaryConstructorToSecondaryIntention.kt @@ -72,7 +72,11 @@ class ConvertPrimaryConstructorToSecondaryIntention : SelfTargetingIntentionarg: Int) { + val arg = arg +} \ No newline at end of file diff --git a/idea/testData/intentions/convertPrimaryConstructorToSecondary/errorType.kt.after b/idea/testData/intentions/convertPrimaryConstructorToSecondary/errorType.kt.after new file mode 100644 index 00000000000..94b7b32c770 --- /dev/null +++ b/idea/testData/intentions/convertPrimaryConstructorToSecondary/errorType.kt.after @@ -0,0 +1,13 @@ +// SKIP_ERRORS_BEFORE +// SKIP_ERRORS_AFTER + +class Foo { + val arg: Int + + constructor(arg: Int) { + this.arg = arg + this.arg = arg + } + + val arg +} \ No newline at end of file diff --git a/idea/tests/org/jetbrains/kotlin/idea/intentions/IntentionTestGenerated.java b/idea/tests/org/jetbrains/kotlin/idea/intentions/IntentionTestGenerated.java index fc68bb4602d..e2f8d7298b8 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/intentions/IntentionTestGenerated.java +++ b/idea/tests/org/jetbrains/kotlin/idea/intentions/IntentionTestGenerated.java @@ -5534,6 +5534,12 @@ public class IntentionTestGenerated extends AbstractIntentionTest { doTest(fileName); } + @TestMetadata("errorType.kt") + public void testErrorType() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/convertPrimaryConstructorToSecondary/errorType.kt"); + doTest(fileName); + } + @TestMetadata("independentProperty.kt") public void testIndependentProperty() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/convertPrimaryConstructorToSecondary/independentProperty.kt");