Skip to content

Commit 22cc3a7

Browse files
committed
Add hopefully helpful comment
1 parent 46da667 commit 22cc3a7

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
@@ -7455,6 +7455,11 @@ module ts {
74557455

74567456
if (node.body) {
74577457
if (!node.type) {
7458+
// There are some checks that are only performed in getReturnTypeFromBody, that may produce errors
7459+
// we need. An example is the noImplicitAny errors resulting from widening the return expression
7460+
// of a function. Because checking of function expression bodies is deferred, there was never an
7461+
// appropriate time to do this during the main walk of the file (see the comment at the top of
7462+
// checkFunctionExpressionBodies). So it must be done now.
74587463
getReturnTypeOfSignature(getSignatureFromDeclaration(node));
74597464
}
74607465

0 commit comments

Comments
 (0)