KT-2334 An error 'local function without body' is not reported

#KT-2334 Fixed
This commit is contained in:
Svetlana Isakova
2014-06-17 09:59:12 +04:00
parent 79cec6411d
commit 17c4930404
3 changed files with 13 additions and 0 deletions
@@ -175,6 +175,9 @@ public class ExpressionTypingVisitorForStatements extends ExpressionTypingVisito
scope, context.dataFlowInfo, context.trace, /* needCompleteAnalysis = */ true);
ModifiersChecker.create(context.trace).checkModifiersForLocalDeclaration(function, functionDescriptor);
if (!function.hasBody()) {
context.trace.report(NON_MEMBER_FUNCTION_NO_BODY.on(function, functionDescriptor));
}
return DataFlowUtils.checkStatementType(function, context, context.dataFlowInfo);
}
@@ -0,0 +1,5 @@
//KT-2334 An error 'local function without body' is not reported
fun foo() {
<!NON_MEMBER_FUNCTION_NO_BODY!>fun bar()<!>
}
@@ -1325,6 +1325,11 @@ public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest {
doTest("compiler/testData/diagnostics/tests/controlFlowAnalysis/kt2330.kt");
}
@TestMetadata("kt2334.kt")
public void testKt2334() throws Exception {
doTest("compiler/testData/diagnostics/tests/controlFlowAnalysis/kt2334.kt");
}
@TestMetadata("kt2369.kt")
public void testKt2369() throws Exception {
doTest("compiler/testData/diagnostics/tests/controlFlowAnalysis/kt2369.kt");