Fix infinite recursion in control flow analyzer inlining logic (#45845)

* Move inlineLevel counter to main type checker scope

* Add regression test
This commit is contained in:
Anders Hejlsberg
2021-09-13 11:02:55 -07:00
committed by GitHub
parent e03600f257
commit 5b84512ccc
6 changed files with 91 additions and 2 deletions

View File

@@ -333,6 +333,7 @@ namespace ts {
let totalInstantiationCount = 0;
let instantiationCount = 0;
let instantiationDepth = 0;
let inlineLevel = 0;
let currentNode: Node | undefined;
const emptySymbols = createSymbolTable();
@@ -23247,7 +23248,6 @@ namespace ts {
let key: string | undefined;
let isKeySet = false;
let flowDepth = 0;
let inlineLevel = 0;
if (flowAnalysisDisabled) {
return errorType;
}