From f623325d778d20d7aba888ca905e55a4d499d24e Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Sun, 14 Apr 2019 09:14:58 -0700 Subject: [PATCH] Improve error message --- src/compiler/checker.ts | 2 +- src/compiler/diagnosticMessages.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index d65d171a4c2..23c336251eb 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -15954,7 +15954,7 @@ namespace ts { const block = findAncestor(node, isFunctionOrModuleBlock); const sourceFile = getSourceFileOfNode(node); const span = getSpanOfTokenAtPosition(sourceFile, block.statements.pos); - diagnostics.add(createFileDiagnostic(sourceFile, span.start, span.length, Diagnostics.The_containing_function_or_module_body_is_too_large_for_control_flow_analysis)); + diagnostics.add(createFileDiagnostic(sourceFile, span.start, span.length, Diagnostics.The_containing_function_or_module_body_is_too_complex_for_control_flow_analysis)); } function getFlowTypeOfReference(reference: Node, declaredType: Type, initialType = declaredType, flowContainer?: Node, couldBeUninitialized?: boolean) { diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 7717f51bd50..a04b76421cc 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -2044,7 +2044,7 @@ "category": "Error", "code": 2562 }, - "The containing function or module body is too large for control flow analysis.": { + "The containing function or module body is too complex for control flow analysis.": { "category": "Error", "code": 2563 },