diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetModifiableBlockHelper.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetModifiableBlockHelper.java index a5e3ddf140c..8133034391d 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetModifiableBlockHelper.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetModifiableBlockHelper.java @@ -65,7 +65,7 @@ public final class JetModifiableBlockHelper { if (declaration != null) { if (declaration instanceof JetNamedFunction) { JetNamedFunction function = (JetNamedFunction) declaration; - if (!function.hasDeclaredReturnType()) { + if (!function.hasDeclaredReturnType() && !function.hasBlockBody()) { return true; } } diff --git a/idea/testData/codeInsight/outOfBlock/InFunInFunWithBody.kt b/idea/testData/codeInsight/outOfBlock/InFunInFunWithBody.kt new file mode 100644 index 00000000000..d936f0e3748 --- /dev/null +++ b/idea/testData/codeInsight/outOfBlock/InFunInFunWithBody.kt @@ -0,0 +1,6 @@ +// FALSE +fun test() { + fun hello() { + + } +} \ No newline at end of file diff --git a/idea/tests/org/jetbrains/jet/plugin/codeInsight/OutOfBlockModificationTest.java b/idea/tests/org/jetbrains/jet/plugin/codeInsight/OutOfBlockModificationTest.java index 91fdb68703a..dbe4cb306c5 100644 --- a/idea/tests/org/jetbrains/jet/plugin/codeInsight/OutOfBlockModificationTest.java +++ b/idea/tests/org/jetbrains/jet/plugin/codeInsight/OutOfBlockModificationTest.java @@ -46,6 +46,10 @@ public class OutOfBlockModificationTest extends LightCodeInsightFixtureTestCase doTest(); } + public void testInFunInFunWithBody() { + doTest(); + } + public void testInFunWithInference() { doTest(); }