Absence of type is not enough for concluding function has type inference

This commit is contained in:
Nikolay Krasko
2012-06-09 15:48:34 +04:00
parent d6f279926c
commit f8926c8a93
3 changed files with 11 additions and 1 deletions
@@ -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;
}
}
@@ -0,0 +1,6 @@
// FALSE
fun test() {
fun hello() {
<caret>
}
}
@@ -46,6 +46,10 @@ public class OutOfBlockModificationTest extends LightCodeInsightFixtureTestCase
doTest();
}
public void testInFunInFunWithBody() {
doTest();
}
public void testInFunWithInference() {
doTest();
}