diff --git a/idea/src/org/jetbrains/jet/plugin/quickfix/ChangeFunctionReturnTypeFix.java b/idea/src/org/jetbrains/jet/plugin/quickfix/ChangeFunctionReturnTypeFix.java index 681b3cfdb2d..ea34a1dbe19 100644 --- a/idea/src/org/jetbrains/jet/plugin/quickfix/ChangeFunctionReturnTypeFix.java +++ b/idea/src/org/jetbrains/jet/plugin/quickfix/ChangeFunctionReturnTypeFix.java @@ -173,4 +173,16 @@ public class ChangeFunctionReturnTypeFix extends JetIntentionAction +} \ No newline at end of file diff --git a/idea/testData/quickfix/typeMismatch/afterNoReturnInFunctionWithBlockBody.kt b/idea/testData/quickfix/typeMismatch/afterNoReturnInFunctionWithBlockBody.kt new file mode 100644 index 00000000000..e8876c8bdeb --- /dev/null +++ b/idea/testData/quickfix/typeMismatch/afterNoReturnInFunctionWithBlockBody.kt @@ -0,0 +1,3 @@ +// "Remove explicitly specified return type in 'foo' function" "true" +fun foo() { +} \ No newline at end of file diff --git a/idea/testData/quickfix/typeMismatch/afterReturnTypeMismatch.kt b/idea/testData/quickfix/typeMismatch/afterReturnTypeMismatch.kt new file mode 100644 index 00000000000..d0cc2249cb8 --- /dev/null +++ b/idea/testData/quickfix/typeMismatch/afterReturnTypeMismatch.kt @@ -0,0 +1,4 @@ +// "Remove explicitly specified return type in 'foo' function" "true" +fun foo() { + return +} \ No newline at end of file diff --git a/idea/testData/quickfix/typeMismatch/beforeChangeReturnTypeWhenFunctionNameIsMissing.kt b/idea/testData/quickfix/typeMismatch/beforeChangeReturnTypeWhenFunctionNameIsMissing.kt new file mode 100644 index 00000000000..5a7e745cead --- /dev/null +++ b/idea/testData/quickfix/typeMismatch/beforeChangeReturnTypeWhenFunctionNameIsMissing.kt @@ -0,0 +1,4 @@ +// "Remove explicitly specified function return type" "true" +fun (): Int { + return +} \ No newline at end of file diff --git a/idea/testData/quickfix/typeMismatch/beforeNoReturnInFunctionWithBlockBody.kt b/idea/testData/quickfix/typeMismatch/beforeNoReturnInFunctionWithBlockBody.kt new file mode 100644 index 00000000000..e254b4f61ed --- /dev/null +++ b/idea/testData/quickfix/typeMismatch/beforeNoReturnInFunctionWithBlockBody.kt @@ -0,0 +1,3 @@ +// "Remove explicitly specified return type in 'foo' function" "true" +fun foo(): Int { +} \ No newline at end of file diff --git a/idea/testData/quickfix/typeMismatch/beforeReturnTypeMismatch.kt b/idea/testData/quickfix/typeMismatch/beforeReturnTypeMismatch.kt new file mode 100644 index 00000000000..7995f7a3e67 --- /dev/null +++ b/idea/testData/quickfix/typeMismatch/beforeReturnTypeMismatch.kt @@ -0,0 +1,4 @@ +// "Remove explicitly specified return type in 'foo' function" "true" +fun foo(): Int { + return +} \ 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 27ed4fe997f..05a974141e4 100644 --- a/idea/tests/org/jetbrains/jet/plugin/quickfix/QuickFixTestGenerated.java +++ b/idea/tests/org/jetbrains/jet/plugin/quickfix/QuickFixTestGenerated.java @@ -998,6 +998,11 @@ public class QuickFixTestGenerated extends AbstractQuickFixTest { JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/quickfix/typeMismatch"), Pattern.compile("^before(\\w+)\\.kt$"), true); } + @TestMetadata("beforeChangeReturnTypeWhenFunctionNameIsMissing.kt") + public void testChangeReturnTypeWhenFunctionNameIsMissing() throws Exception { + doTest("idea/testData/quickfix/typeMismatch/beforeChangeReturnTypeWhenFunctionNameIsMissing.kt"); + } + @TestMetadata("beforeChangeReturnTypeWhenValueParameterListIsAbsent.kt") public void testChangeReturnTypeWhenValueParameterListIsAbsent() throws Exception { doTest("idea/testData/quickfix/typeMismatch/beforeChangeReturnTypeWhenValueParameterListIsAbsent.kt"); @@ -1048,6 +1053,16 @@ public class QuickFixTestGenerated extends AbstractQuickFixTest { doTest("idea/testData/quickfix/typeMismatch/beforeHasNextFunctionReturnTypeMismatch.kt"); } + @TestMetadata("beforeNoReturnInFunctionWithBlockBody.kt") + public void testNoReturnInFunctionWithBlockBody() throws Exception { + doTest("idea/testData/quickfix/typeMismatch/beforeNoReturnInFunctionWithBlockBody.kt"); + } + + @TestMetadata("beforeReturnTypeMismatch.kt") + public void testReturnTypeMismatch() throws Exception { + doTest("idea/testData/quickfix/typeMismatch/beforeReturnTypeMismatch.kt"); + } + } @TestMetadata("idea/testData/quickfix/typeProjection")