diff --git a/idea/src/org/jetbrains/kotlin/idea/intentions/RemoveExplicitTypeIntention.kt b/idea/src/org/jetbrains/kotlin/idea/intentions/RemoveExplicitTypeIntention.kt index bac14c6550f..a60fb4d974a 100644 --- a/idea/src/org/jetbrains/kotlin/idea/intentions/RemoveExplicitTypeIntention.kt +++ b/idea/src/org/jetbrains/kotlin/idea/intentions/RemoveExplicitTypeIntention.kt @@ -19,6 +19,8 @@ package org.jetbrains.kotlin.idea.intentions import com.intellij.openapi.editor.Editor import com.intellij.openapi.util.TextRange import org.jetbrains.kotlin.descriptors.FunctionDescriptor +import org.jetbrains.kotlin.idea.refactoring.addTypeArgumentsIfNeeded +import org.jetbrains.kotlin.idea.refactoring.getQualifiedTypeArgumentList import org.jetbrains.kotlin.idea.search.usagesSearch.descriptor import org.jetbrains.kotlin.psi.* import org.jetbrains.kotlin.psi.psiUtil.endOffset @@ -35,7 +37,10 @@ class RemoveExplicitTypeIntention : SelfTargetingRangeIntentionSet = setOf() \ No newline at end of file diff --git a/idea/testData/intentions/removeExplicitType/needTypeArgument.kt.after b/idea/testData/intentions/removeExplicitType/needTypeArgument.kt.after new file mode 100644 index 00000000000..55344e969ab --- /dev/null +++ b/idea/testData/intentions/removeExplicitType/needTypeArgument.kt.after @@ -0,0 +1,2 @@ +// WITH_RUNTIME +val x = setOf() \ No newline at end of file diff --git a/idea/testData/intentions/removeExplicitType/needTypeArgument2.kt b/idea/testData/intentions/removeExplicitType/needTypeArgument2.kt new file mode 100644 index 00000000000..a64653649f0 --- /dev/null +++ b/idea/testData/intentions/removeExplicitType/needTypeArgument2.kt @@ -0,0 +1,2 @@ +class Foo +val foo: Foo = Foo() \ No newline at end of file diff --git a/idea/testData/intentions/removeExplicitType/needTypeArgument2.kt.after b/idea/testData/intentions/removeExplicitType/needTypeArgument2.kt.after new file mode 100644 index 00000000000..5d1dc11e6b5 --- /dev/null +++ b/idea/testData/intentions/removeExplicitType/needTypeArgument2.kt.after @@ -0,0 +1,2 @@ +class Foo +val foo = Foo() \ 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 6528eb35547..64c02d9b4cf 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/intentions/IntentionTestGenerated.java +++ b/idea/tests/org/jetbrains/kotlin/idea/intentions/IntentionTestGenerated.java @@ -13146,6 +13146,16 @@ public class IntentionTestGenerated extends AbstractIntentionTest { runTest("idea/testData/intentions/removeExplicitType/lambdaInitializer5.kt"); } + @TestMetadata("needTypeArgument.kt") + public void testNeedTypeArgument() throws Exception { + runTest("idea/testData/intentions/removeExplicitType/needTypeArgument.kt"); + } + + @TestMetadata("needTypeArgument2.kt") + public void testNeedTypeArgument2() throws Exception { + runTest("idea/testData/intentions/removeExplicitType/needTypeArgument2.kt"); + } + @TestMetadata("notOnParameterOfFunctionType.kt") public void testNotOnParameterOfFunctionType() throws Exception { runTest("idea/testData/intentions/removeExplicitType/notOnParameterOfFunctionType.kt");