From 93b5eec71e1b74e114e22bd4313ddc094a11b28e Mon Sep 17 00:00:00 2001 From: nd Date: Mon, 8 May 2017 15:24:37 +0200 Subject: [PATCH] Convert to secondary constructor is not applicable to data classes (#1071) #KT-15942 Fixed --- .../ConvertPrimaryConstructorToSecondaryIntention.kt | 2 +- .../convertPrimaryConstructorToSecondary/dataClass.kt | 3 +++ .../kotlin/idea/intentions/IntentionTestGenerated.java | 6 ++++++ 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 idea/testData/intentions/convertPrimaryConstructorToSecondary/dataClass.kt diff --git a/idea/src/org/jetbrains/kotlin/idea/intentions/ConvertPrimaryConstructorToSecondaryIntention.kt b/idea/src/org/jetbrains/kotlin/idea/intentions/ConvertPrimaryConstructorToSecondaryIntention.kt index e934530c0fb..c9d2ee2e8fb 100644 --- a/idea/src/org/jetbrains/kotlin/idea/intentions/ConvertPrimaryConstructorToSecondaryIntention.kt +++ b/idea/src/org/jetbrains/kotlin/idea/intentions/ConvertPrimaryConstructorToSecondaryIntention.kt @@ -42,7 +42,7 @@ class ConvertPrimaryConstructorToSecondaryIntention : SelfTargetingIntention(val value: String) \ 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 cfb5627fcf8..032c2da192c 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/intentions/IntentionTestGenerated.java +++ b/idea/tests/org/jetbrains/kotlin/idea/intentions/IntentionTestGenerated.java @@ -5030,6 +5030,12 @@ public class IntentionTestGenerated extends AbstractIntentionTest { doTest(fileName); } + @TestMetadata("dataClass.kt") + public void testDataClass() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/convertPrimaryConstructorToSecondary/dataClass.kt"); + doTest(fileName); + } + @TestMetadata("defaultValueChain.kt") public void testDefaultValueChain() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/convertPrimaryConstructorToSecondary/defaultValueChain.kt");