tsc-ts 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -1
- package/dist/api/compiler/ast.d.ts +6 -0
- package/dist/api/compiler/ast.js +19 -3
- package/dist/api/compiler/checker-functions.js +5 -1
- package/dist/api/compiler/checker-grammar.d.ts +39 -4
- package/dist/api/compiler/checker-grammar.js +239 -75
- package/dist/api/compiler/checker-heritage.js +20 -14
- package/dist/api/compiler/checker-modules.js +4 -2
- package/dist/api/compiler/checker-narrowing.d.ts +7 -0
- package/dist/api/compiler/checker-narrowing.js +31 -4
- package/dist/api/compiler/checker-source-file.js +16 -1
- package/dist/api/compiler/checker-statements.js +11 -2
- package/dist/api/compiler/checker-type-factory.js +17 -7
- package/dist/api/compiler/checker-type-nodes.d.ts +1 -1
- package/dist/api/compiler/checker-type-nodes.js +5 -5
- package/dist/api/compiler/checker-unused.js +15 -10
- package/dist/api/compiler/checker.d.ts +4 -0
- package/dist/api/compiler/checker.js +6 -0
- package/dist/api/compiler/file-loader.d.ts +5 -0
- package/dist/api/compiler/file-loader.js +7 -0
- package/dist/api/compiler/program-checker.d.ts +18 -0
- package/dist/api/compiler/program-checker.js +27 -0
- package/package.json +14 -9
- package/src/compiler/ast.ts +20 -3
- package/src/compiler/checker-functions.ts +5 -0
- package/src/compiler/checker-grammar.ts +247 -88
- package/src/compiler/checker-heritage.ts +31 -17
- package/src/compiler/checker-modules.ts +4 -2
- package/src/compiler/checker-narrowing.ts +30 -4
- package/src/compiler/checker-source-file.ts +16 -1
- package/src/compiler/checker-statements.ts +10 -2
- package/src/compiler/checker-type-factory.ts +14 -7
- package/src/compiler/checker-type-nodes.ts +5 -5
- package/src/compiler/checker-unused.ts +13 -8
- package/src/compiler/checker.ts +6 -0
- package/src/compiler/file-loader.ts +8 -0
- package/src/compiler/parallel-check.ts +13 -1
- package/src/compiler/parse-thread.ts +24 -2
- package/src/compiler/program-checker.ts +28 -0
- package/src/compiler/run-records.ts +12 -5
- package/src/compiler/tsc-compile.ts +10 -1
|
@@ -114,6 +114,7 @@ import {
|
|
|
114
114
|
} from './checker-jsdoc.js';
|
|
115
115
|
import { getEffectiveCheckNode, isFunctionLike, nodeIsMissing } from './ast-utilities.js';
|
|
116
116
|
import {
|
|
117
|
+
endFlowAnalysisStop,
|
|
117
118
|
getFlowTypeOfReferenceAt,
|
|
118
119
|
isConstantReference,
|
|
119
120
|
isReachableFlowNode,
|
|
@@ -437,6 +438,10 @@ export function checkFunctionLikeBody(c: Checker, node: Node): void {
|
|
|
437
438
|
if (returnType !== undefined)
|
|
438
439
|
checkReturnExpression(c, node, unwrapReturnType(c, returnType, functionFlags), body, body, exprType, false);
|
|
439
440
|
}
|
|
441
|
+
// A body too large for control flow analysis stops narrowing in the rest of that body only
|
|
442
|
+
// (flowAnalysisDisabled, checker-narrowing.ts); what follows the body starts over. Inferring the
|
|
443
|
+
// return type above checks the body's return expressions, which can reach the limit.
|
|
444
|
+
endFlowAnalysisStop(c, body);
|
|
440
445
|
}
|
|
441
446
|
|
|
442
447
|
/** Checks a generator's or async function's return type annotation. */
|