KT-2334 An error 'local function without body' is not reported
#KT-2334 Fixed
This commit is contained in:
+3
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user