From 6ff567927408665ef68062061ac2b9102d6ef053 Mon Sep 17 00:00:00 2001 From: Vladimir Matveev Date: Mon, 30 Nov 2015 09:34:32 -0800 Subject: [PATCH] fix typo in comment --- src/compiler/checker.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index a803bd8ba4..545f311148 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -9876,7 +9876,7 @@ namespace ts { } // If all we have is a function signature, or an arrow function with an expression body, then there is nothing to check. - // also if HasImplicitReturn flag is not set this means that all codepaths in function body end with return of throw + // also if HasImplicitReturn flag is not set this means that all codepaths in function body end with return or throw if (nodeIsMissing(func.body) || func.body.kind !== SyntaxKind.Block || !(func.flags & NodeFlags.HasImplicitReturn)) { return; } @@ -9890,7 +9890,6 @@ namespace ts { error(func.type, Diagnostics.A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value); } else if (compilerOptions.noImplicitReturns) { - // errors in this branch should only be reported if CompilerOptions.noImplicitReturns flag is set if (!returnType) { // If return type annotation is omitted check if function has any explicit return statements. // If it does not have any - its inferred return type is void - don't do any checks.