From d6e21b1c2100f58c412cf7a1dc5a0876bc891218 Mon Sep 17 00:00:00 2001 From: Toshiaki Kameyama Date: Sun, 10 Feb 2019 15:16:08 +0900 Subject: [PATCH] Convert to secondary constructor: do not suggest when property has val/var and no name #KT-29056 Fixed --- .../ConvertPrimaryConstructorToSecondaryIntention.kt | 2 +- .../convertPrimaryConstructorToSecondary/noArgNameVal.kt | 2 ++ .../kotlin/idea/intentions/IntentionTestGenerated.java | 5 +++++ 3 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 idea/testData/intentions/convertPrimaryConstructorToSecondary/noArgNameVal.kt diff --git a/idea/src/org/jetbrains/kotlin/idea/intentions/ConvertPrimaryConstructorToSecondaryIntention.kt b/idea/src/org/jetbrains/kotlin/idea/intentions/ConvertPrimaryConstructorToSecondaryIntention.kt index d360b47a11a..b69b1718683 100644 --- a/idea/src/org/jetbrains/kotlin/idea/intentions/ConvertPrimaryConstructorToSecondaryIntention.kt +++ b/idea/src/org/jetbrains/kotlin/idea/intentions/ConvertPrimaryConstructorToSecondaryIntention.kt @@ -44,7 +44,7 @@ class ConvertPrimaryConstructorToSecondaryIntention : SelfTargetingIntention(val: 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 95e2c28c7a9..fccfedb1cf2 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/intentions/IntentionTestGenerated.java +++ b/idea/tests/org/jetbrains/kotlin/idea/intentions/IntentionTestGenerated.java @@ -6229,6 +6229,11 @@ public class IntentionTestGenerated extends AbstractIntentionTest { runTest("idea/testData/intentions/convertPrimaryConstructorToSecondary/noArgName.kt"); } + @TestMetadata("noArgNameVal.kt") + public void testNoArgNameVal() throws Exception { + runTest("idea/testData/intentions/convertPrimaryConstructorToSecondary/noArgNameVal.kt"); + } + @TestMetadata("noArgType.kt") public void testNoArgType() throws Exception { runTest("idea/testData/intentions/convertPrimaryConstructorToSecondary/noArgType.kt");