diff --git a/idea/src/org/jetbrains/jet/plugin/quickfix/ChangeToStarProjectionFix.java b/idea/src/org/jetbrains/jet/plugin/quickfix/ChangeToStarProjectionFix.java index 0a94d425789..18c050c42d3 100644 --- a/idea/src/org/jetbrains/jet/plugin/quickfix/ChangeToStarProjectionFix.java +++ b/idea/src/org/jetbrains/jet/plugin/quickfix/ChangeToStarProjectionFix.java @@ -59,11 +59,17 @@ public class ChangeToStarProjectionFix extends JetIntentionAction" "true" +fun isStringToIntMap(map : Any) = map is Map<*, *> \ No newline at end of file diff --git a/idea/testData/quickfix/addStarProjections/checkType/afterChangeToStarProjectionNullable.kt b/idea/testData/quickfix/addStarProjections/checkType/afterChangeToStarProjectionNullable.kt new file mode 100644 index 00000000000..2fde707f30a --- /dev/null +++ b/idea/testData/quickfix/addStarProjections/checkType/afterChangeToStarProjectionNullable.kt @@ -0,0 +1,2 @@ +// "Change type argument list to <*>" "true" +fun isStringList(list : Any) = list is List<*>? \ No newline at end of file diff --git a/idea/testData/quickfix/addStarProjections/checkType/afterChangeToStarProjectionSingleParameter.kt b/idea/testData/quickfix/addStarProjections/checkType/afterChangeToStarProjectionSingleParameter.kt new file mode 100644 index 00000000000..dd9e7303574 --- /dev/null +++ b/idea/testData/quickfix/addStarProjections/checkType/afterChangeToStarProjectionSingleParameter.kt @@ -0,0 +1,2 @@ +// "Change type argument list to <*>" "true" +fun isStringList(list : Any?) = list is (List<*>) \ No newline at end of file diff --git a/idea/testData/quickfix/addStarProjections/checkType/beforeChangeToStarProjectionMultipleParameters.kt b/idea/testData/quickfix/addStarProjections/checkType/beforeChangeToStarProjectionMultipleParameters.kt new file mode 100644 index 00000000000..fbe68541fe6 --- /dev/null +++ b/idea/testData/quickfix/addStarProjections/checkType/beforeChangeToStarProjectionMultipleParameters.kt @@ -0,0 +1,2 @@ +// "Change type argument list to <*, *>" "true" +fun isStringToIntMap(map : Any) = map is Map<String, Int> \ No newline at end of file diff --git a/idea/testData/quickfix/addStarProjections/checkType/beforeChangeToStarProjectionNullable.kt b/idea/testData/quickfix/addStarProjections/checkType/beforeChangeToStarProjectionNullable.kt new file mode 100644 index 00000000000..5854e690c44 --- /dev/null +++ b/idea/testData/quickfix/addStarProjections/checkType/beforeChangeToStarProjectionNullable.kt @@ -0,0 +1,2 @@ +// "Change type argument list to <*>" "true" +fun isStringList(list : Any) = list is List<String>? \ No newline at end of file diff --git a/idea/testData/quickfix/addStarProjections/checkType/beforeChangeToStarProjectionSingleParameter.kt b/idea/testData/quickfix/addStarProjections/checkType/beforeChangeToStarProjectionSingleParameter.kt new file mode 100644 index 00000000000..2f807b2736b --- /dev/null +++ b/idea/testData/quickfix/addStarProjections/checkType/beforeChangeToStarProjectionSingleParameter.kt @@ -0,0 +1,2 @@ +// "Change type argument list to <*>" "true" +fun isStringList(list : Any?) = list is (List<String>) \ No newline at end of file diff --git a/idea/tests/org/jetbrains/jet/plugin/quickfix/QuickFixTestGenerated.java b/idea/tests/org/jetbrains/jet/plugin/quickfix/QuickFixTestGenerated.java index 77ce71d4627..92e6c9c070d 100644 --- a/idea/tests/org/jetbrains/jet/plugin/quickfix/QuickFixTestGenerated.java +++ b/idea/tests/org/jetbrains/jet/plugin/quickfix/QuickFixTestGenerated.java @@ -146,7 +146,7 @@ public class QuickFixTestGenerated extends AbstractQuickFixTest { } @TestMetadata("idea/testData/quickfix/addStarProjections") - @InnerTestClasses({AddStarProjections.Cast.class, AddStarProjections.JavaClass.class, AddStarProjections.When.class}) + @InnerTestClasses({AddStarProjections.Cast.class, AddStarProjections.CheckType.class, AddStarProjections.JavaClass.class, AddStarProjections.When.class}) public static class AddStarProjections extends AbstractQuickFixTest { public void testAllFilesPresentInAddStarProjections() throws Exception { JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/quickfix/addStarProjections"), Pattern.compile("^before(\\w+)\\.kt$"), true); @@ -200,6 +200,29 @@ public class QuickFixTestGenerated extends AbstractQuickFixTest { } + @TestMetadata("idea/testData/quickfix/addStarProjections/checkType") + public static class CheckType extends AbstractQuickFixTest { + public void testAllFilesPresentInCheckType() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/quickfix/addStarProjections/checkType"), Pattern.compile("^before(\\w+)\\.kt$"), true); + } + + @TestMetadata("beforeChangeToStarProjectionMultipleParameters.kt") + public void testChangeToStarProjectionMultipleParameters() throws Exception { + doTest("idea/testData/quickfix/addStarProjections/checkType/beforeChangeToStarProjectionMultipleParameters.kt"); + } + + @TestMetadata("beforeChangeToStarProjectionNullable.kt") + public void testChangeToStarProjectionNullable() throws Exception { + doTest("idea/testData/quickfix/addStarProjections/checkType/beforeChangeToStarProjectionNullable.kt"); + } + + @TestMetadata("beforeChangeToStarProjectionSingleParameter.kt") + public void testChangeToStarProjectionSingleParameter() throws Exception { + doTest("idea/testData/quickfix/addStarProjections/checkType/beforeChangeToStarProjectionSingleParameter.kt"); + } + + } + @TestMetadata("idea/testData/quickfix/addStarProjections/javaClass") public static class JavaClass extends AbstractQuickFixTest { public void testAllFilesPresentInJavaClass() throws Exception { @@ -270,6 +293,7 @@ public class QuickFixTestGenerated extends AbstractQuickFixTest { TestSuite suite = new TestSuite("AddStarProjections"); suite.addTestSuite(AddStarProjections.class); suite.addTestSuite(Cast.class); + suite.addTestSuite(CheckType.class); suite.addTestSuite(JavaClass.class); suite.addTestSuite(When.class); return suite;