Skip to content

Commit 155d7f4

Browse files
committed
Add hopefully helpful comment
1 parent 1bd7f52 commit 155d7f4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/compiler/checker.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7658,6 +7658,11 @@ module ts {
76587658

76597659
if (node.body) {
76607660
if (!node.type) {
7661+
// There are some checks that are only performed in getReturnTypeFromBody, that may produce errors
7662+
// we need. An example is the noImplicitAny errors resulting from widening the return expression
7663+
// of a function. Because checking of function expression bodies is deferred, there was never an
7664+
// appropriate time to do this during the main walk of the file (see the comment at the top of
7665+
// checkFunctionExpressionBodies). So it must be done now.
76617666
getReturnTypeOfSignature(getSignatureFromDeclaration(node));
76627667
}
76637668

0 commit comments

Comments
 (0)