diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index c1303ab9e5c22..9cba48a937846 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -21730,6 +21730,7 @@ namespace ts { return errorType; } flowDepth++; + let sharedFlow: FlowNode | undefined; while (true) { const flags = flow.flags; if (flags & FlowFlags.Shared) { @@ -21742,6 +21743,7 @@ namespace ts { return sharedFlowTypes[i]; } } + sharedFlow = flow; } let type: FlowType | undefined; if (flags & FlowFlags.Assignment) { @@ -21805,9 +21807,9 @@ namespace ts { // simply return the non-auto declared type to reduce follow-on errors. type = convertAutoToAny(declaredType); } - if (flags & FlowFlags.Shared) { + if (sharedFlow) { // Record visited node and the associated type in the cache. - sharedFlowNodes[sharedFlowCount] = flow; + sharedFlowNodes[sharedFlowCount] = sharedFlow; sharedFlowTypes[sharedFlowCount] = type; sharedFlowCount++; } diff --git a/tests/baselines/reference/controlFlowManyCallExpressionStatementsPerf.js b/tests/baselines/reference/controlFlowManyCallExpressionStatementsPerf.js new file mode 100644 index 0000000000000..0198ae5327e85 --- /dev/null +++ b/tests/baselines/reference/controlFlowManyCallExpressionStatementsPerf.js @@ -0,0 +1,127 @@ +//// [controlFlowManyCallExpressionStatementsPerf.ts] +function test(x: boolean): boolean { return x; } + +let state = true; + +if (state) { + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); +} + + +//// [controlFlowManyCallExpressionStatementsPerf.js] +"use strict"; +function test(x) { return x; } +var state = true; +if (state) { + test(state && state); + test(state && state); + test(state && state); + test(state && state); + test(state && state); + test(state && state); + test(state && state); + test(state && state); + test(state && state); + test(state && state); + test(state && state); + test(state && state); + test(state && state); + test(state && state); + test(state && state); + test(state && state); + test(state && state); + test(state && state); + test(state && state); + test(state && state); + test(state && state); + test(state && state); + test(state && state); + test(state && state); + test(state && state); + test(state && state); + test(state && state); + test(state && state); + test(state && state); + test(state && state); + test(state && state); + test(state && state); + test(state && state); + test(state && state); + test(state && state); + test(state && state); + test(state && state); + test(state && state); + test(state && state); + test(state && state); + test(state && state); + test(state && state); + test(state && state); + test(state && state); + test(state && state); + test(state && state); + test(state && state); + test(state && state); + test(state && state); + test(state && state); + test(state && state); + test(state && state); + test(state && state); + test(state && state); + test(state && state); + test(state && state); +} diff --git a/tests/baselines/reference/controlFlowManyCallExpressionStatementsPerf.symbols b/tests/baselines/reference/controlFlowManyCallExpressionStatementsPerf.symbols new file mode 100644 index 0000000000000..0f0f3124e7b36 --- /dev/null +++ b/tests/baselines/reference/controlFlowManyCallExpressionStatementsPerf.symbols @@ -0,0 +1,293 @@ +=== tests/cases/compiler/controlFlowManyCallExpressionStatementsPerf.ts === +function test(x: boolean): boolean { return x; } +>test : Symbol(test, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 0, 0)) +>x : Symbol(x, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 0, 14)) +>x : Symbol(x, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 0, 14)) + +let state = true; +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) + +if (state) { +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) + + test(state as any && state); +>test : Symbol(test, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 0, 0)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) + + test(state as any && state); +>test : Symbol(test, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 0, 0)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) + + test(state as any && state); +>test : Symbol(test, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 0, 0)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) + + test(state as any && state); +>test : Symbol(test, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 0, 0)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) + + test(state as any && state); +>test : Symbol(test, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 0, 0)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) + + test(state as any && state); +>test : Symbol(test, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 0, 0)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) + + test(state as any && state); +>test : Symbol(test, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 0, 0)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) + + test(state as any && state); +>test : Symbol(test, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 0, 0)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) + + test(state as any && state); +>test : Symbol(test, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 0, 0)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) + + test(state as any && state); +>test : Symbol(test, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 0, 0)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) + + test(state as any && state); +>test : Symbol(test, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 0, 0)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) + + test(state as any && state); +>test : Symbol(test, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 0, 0)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) + + test(state as any && state); +>test : Symbol(test, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 0, 0)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) + + test(state as any && state); +>test : Symbol(test, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 0, 0)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) + + test(state as any && state); +>test : Symbol(test, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 0, 0)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) + + test(state as any && state); +>test : Symbol(test, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 0, 0)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) + + test(state as any && state); +>test : Symbol(test, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 0, 0)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) + + test(state as any && state); +>test : Symbol(test, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 0, 0)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) + + test(state as any && state); +>test : Symbol(test, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 0, 0)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) + + test(state as any && state); +>test : Symbol(test, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 0, 0)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) + + test(state as any && state); +>test : Symbol(test, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 0, 0)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) + + test(state as any && state); +>test : Symbol(test, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 0, 0)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) + + test(state as any && state); +>test : Symbol(test, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 0, 0)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) + + test(state as any && state); +>test : Symbol(test, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 0, 0)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) + + test(state as any && state); +>test : Symbol(test, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 0, 0)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) + + test(state as any && state); +>test : Symbol(test, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 0, 0)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) + + test(state as any && state); +>test : Symbol(test, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 0, 0)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) + + test(state as any && state); +>test : Symbol(test, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 0, 0)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) + + test(state as any && state); +>test : Symbol(test, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 0, 0)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) + + test(state as any && state); +>test : Symbol(test, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 0, 0)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) + + test(state as any && state); +>test : Symbol(test, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 0, 0)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) + + test(state as any && state); +>test : Symbol(test, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 0, 0)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) + + test(state as any && state); +>test : Symbol(test, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 0, 0)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) + + test(state as any && state); +>test : Symbol(test, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 0, 0)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) + + test(state as any && state); +>test : Symbol(test, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 0, 0)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) + + test(state as any && state); +>test : Symbol(test, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 0, 0)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) + + test(state as any && state); +>test : Symbol(test, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 0, 0)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) + + test(state as any && state); +>test : Symbol(test, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 0, 0)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) + + test(state as any && state); +>test : Symbol(test, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 0, 0)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) + + test(state as any && state); +>test : Symbol(test, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 0, 0)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) + + test(state as any && state); +>test : Symbol(test, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 0, 0)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) + + test(state as any && state); +>test : Symbol(test, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 0, 0)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) + + test(state as any && state); +>test : Symbol(test, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 0, 0)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) + + test(state as any && state); +>test : Symbol(test, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 0, 0)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) + + test(state as any && state); +>test : Symbol(test, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 0, 0)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) + + test(state as any && state); +>test : Symbol(test, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 0, 0)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) + + test(state as any && state); +>test : Symbol(test, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 0, 0)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) + + test(state as any && state); +>test : Symbol(test, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 0, 0)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) + + test(state as any && state); +>test : Symbol(test, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 0, 0)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) + + test(state as any && state); +>test : Symbol(test, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 0, 0)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) + + test(state as any && state); +>test : Symbol(test, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 0, 0)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) + + test(state as any && state); +>test : Symbol(test, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 0, 0)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) + + test(state as any && state); +>test : Symbol(test, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 0, 0)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) + + test(state as any && state); +>test : Symbol(test, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 0, 0)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) + + test(state as any && state); +>test : Symbol(test, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 0, 0)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) + + test(state as any && state); +>test : Symbol(test, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 0, 0)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) +>state : Symbol(state, Decl(controlFlowManyCallExpressionStatementsPerf.ts, 2, 3)) +} + diff --git a/tests/baselines/reference/controlFlowManyCallExpressionStatementsPerf.types b/tests/baselines/reference/controlFlowManyCallExpressionStatementsPerf.types new file mode 100644 index 0000000000000..bbc68ee76c870 --- /dev/null +++ b/tests/baselines/reference/controlFlowManyCallExpressionStatementsPerf.types @@ -0,0 +1,462 @@ +=== tests/cases/compiler/controlFlowManyCallExpressionStatementsPerf.ts === +function test(x: boolean): boolean { return x; } +>test : (x: boolean) => boolean +>x : boolean +>x : boolean + +let state = true; +>state : boolean +>true : true + +if (state) { +>state : true + + test(state as any && state); +>test(state as any && state) : boolean +>test : (x: boolean) => boolean +>state as any && state : any +>state as any : any +>state : true +>state : true + + test(state as any && state); +>test(state as any && state) : boolean +>test : (x: boolean) => boolean +>state as any && state : any +>state as any : any +>state : true +>state : true + + test(state as any && state); +>test(state as any && state) : boolean +>test : (x: boolean) => boolean +>state as any && state : any +>state as any : any +>state : true +>state : true + + test(state as any && state); +>test(state as any && state) : boolean +>test : (x: boolean) => boolean +>state as any && state : any +>state as any : any +>state : true +>state : true + + test(state as any && state); +>test(state as any && state) : boolean +>test : (x: boolean) => boolean +>state as any && state : any +>state as any : any +>state : true +>state : true + + test(state as any && state); +>test(state as any && state) : boolean +>test : (x: boolean) => boolean +>state as any && state : any +>state as any : any +>state : true +>state : true + + test(state as any && state); +>test(state as any && state) : boolean +>test : (x: boolean) => boolean +>state as any && state : any +>state as any : any +>state : true +>state : true + + test(state as any && state); +>test(state as any && state) : boolean +>test : (x: boolean) => boolean +>state as any && state : any +>state as any : any +>state : true +>state : true + + test(state as any && state); +>test(state as any && state) : boolean +>test : (x: boolean) => boolean +>state as any && state : any +>state as any : any +>state : true +>state : true + + test(state as any && state); +>test(state as any && state) : boolean +>test : (x: boolean) => boolean +>state as any && state : any +>state as any : any +>state : true +>state : true + + test(state as any && state); +>test(state as any && state) : boolean +>test : (x: boolean) => boolean +>state as any && state : any +>state as any : any +>state : true +>state : true + + test(state as any && state); +>test(state as any && state) : boolean +>test : (x: boolean) => boolean +>state as any && state : any +>state as any : any +>state : true +>state : true + + test(state as any && state); +>test(state as any && state) : boolean +>test : (x: boolean) => boolean +>state as any && state : any +>state as any : any +>state : true +>state : true + + test(state as any && state); +>test(state as any && state) : boolean +>test : (x: boolean) => boolean +>state as any && state : any +>state as any : any +>state : true +>state : true + + test(state as any && state); +>test(state as any && state) : boolean +>test : (x: boolean) => boolean +>state as any && state : any +>state as any : any +>state : true +>state : true + + test(state as any && state); +>test(state as any && state) : boolean +>test : (x: boolean) => boolean +>state as any && state : any +>state as any : any +>state : true +>state : true + + test(state as any && state); +>test(state as any && state) : boolean +>test : (x: boolean) => boolean +>state as any && state : any +>state as any : any +>state : true +>state : true + + test(state as any && state); +>test(state as any && state) : boolean +>test : (x: boolean) => boolean +>state as any && state : any +>state as any : any +>state : true +>state : true + + test(state as any && state); +>test(state as any && state) : boolean +>test : (x: boolean) => boolean +>state as any && state : any +>state as any : any +>state : true +>state : true + + test(state as any && state); +>test(state as any && state) : boolean +>test : (x: boolean) => boolean +>state as any && state : any +>state as any : any +>state : true +>state : true + + test(state as any && state); +>test(state as any && state) : boolean +>test : (x: boolean) => boolean +>state as any && state : any +>state as any : any +>state : true +>state : true + + test(state as any && state); +>test(state as any && state) : boolean +>test : (x: boolean) => boolean +>state as any && state : any +>state as any : any +>state : true +>state : true + + test(state as any && state); +>test(state as any && state) : boolean +>test : (x: boolean) => boolean +>state as any && state : any +>state as any : any +>state : true +>state : true + + test(state as any && state); +>test(state as any && state) : boolean +>test : (x: boolean) => boolean +>state as any && state : any +>state as any : any +>state : true +>state : true + + test(state as any && state); +>test(state as any && state) : boolean +>test : (x: boolean) => boolean +>state as any && state : any +>state as any : any +>state : true +>state : true + + test(state as any && state); +>test(state as any && state) : boolean +>test : (x: boolean) => boolean +>state as any && state : any +>state as any : any +>state : true +>state : true + + test(state as any && state); +>test(state as any && state) : boolean +>test : (x: boolean) => boolean +>state as any && state : any +>state as any : any +>state : true +>state : true + + test(state as any && state); +>test(state as any && state) : boolean +>test : (x: boolean) => boolean +>state as any && state : any +>state as any : any +>state : true +>state : true + + test(state as any && state); +>test(state as any && state) : boolean +>test : (x: boolean) => boolean +>state as any && state : any +>state as any : any +>state : true +>state : true + + test(state as any && state); +>test(state as any && state) : boolean +>test : (x: boolean) => boolean +>state as any && state : any +>state as any : any +>state : true +>state : true + + test(state as any && state); +>test(state as any && state) : boolean +>test : (x: boolean) => boolean +>state as any && state : any +>state as any : any +>state : true +>state : true + + test(state as any && state); +>test(state as any && state) : boolean +>test : (x: boolean) => boolean +>state as any && state : any +>state as any : any +>state : true +>state : true + + test(state as any && state); +>test(state as any && state) : boolean +>test : (x: boolean) => boolean +>state as any && state : any +>state as any : any +>state : true +>state : true + + test(state as any && state); +>test(state as any && state) : boolean +>test : (x: boolean) => boolean +>state as any && state : any +>state as any : any +>state : true +>state : true + + test(state as any && state); +>test(state as any && state) : boolean +>test : (x: boolean) => boolean +>state as any && state : any +>state as any : any +>state : true +>state : true + + test(state as any && state); +>test(state as any && state) : boolean +>test : (x: boolean) => boolean +>state as any && state : any +>state as any : any +>state : true +>state : true + + test(state as any && state); +>test(state as any && state) : boolean +>test : (x: boolean) => boolean +>state as any && state : any +>state as any : any +>state : true +>state : true + + test(state as any && state); +>test(state as any && state) : boolean +>test : (x: boolean) => boolean +>state as any && state : any +>state as any : any +>state : true +>state : true + + test(state as any && state); +>test(state as any && state) : boolean +>test : (x: boolean) => boolean +>state as any && state : any +>state as any : any +>state : true +>state : true + + test(state as any && state); +>test(state as any && state) : boolean +>test : (x: boolean) => boolean +>state as any && state : any +>state as any : any +>state : true +>state : true + + test(state as any && state); +>test(state as any && state) : boolean +>test : (x: boolean) => boolean +>state as any && state : any +>state as any : any +>state : true +>state : true + + test(state as any && state); +>test(state as any && state) : boolean +>test : (x: boolean) => boolean +>state as any && state : any +>state as any : any +>state : true +>state : true + + test(state as any && state); +>test(state as any && state) : boolean +>test : (x: boolean) => boolean +>state as any && state : any +>state as any : any +>state : true +>state : true + + test(state as any && state); +>test(state as any && state) : boolean +>test : (x: boolean) => boolean +>state as any && state : any +>state as any : any +>state : true +>state : true + + test(state as any && state); +>test(state as any && state) : boolean +>test : (x: boolean) => boolean +>state as any && state : any +>state as any : any +>state : true +>state : true + + test(state as any && state); +>test(state as any && state) : boolean +>test : (x: boolean) => boolean +>state as any && state : any +>state as any : any +>state : true +>state : true + + test(state as any && state); +>test(state as any && state) : boolean +>test : (x: boolean) => boolean +>state as any && state : any +>state as any : any +>state : true +>state : true + + test(state as any && state); +>test(state as any && state) : boolean +>test : (x: boolean) => boolean +>state as any && state : any +>state as any : any +>state : true +>state : true + + test(state as any && state); +>test(state as any && state) : boolean +>test : (x: boolean) => boolean +>state as any && state : any +>state as any : any +>state : true +>state : true + + test(state as any && state); +>test(state as any && state) : boolean +>test : (x: boolean) => boolean +>state as any && state : any +>state as any : any +>state : true +>state : true + + test(state as any && state); +>test(state as any && state) : boolean +>test : (x: boolean) => boolean +>state as any && state : any +>state as any : any +>state : true +>state : true + + test(state as any && state); +>test(state as any && state) : boolean +>test : (x: boolean) => boolean +>state as any && state : any +>state as any : any +>state : true +>state : true + + test(state as any && state); +>test(state as any && state) : boolean +>test : (x: boolean) => boolean +>state as any && state : any +>state as any : any +>state : true +>state : true + + test(state as any && state); +>test(state as any && state) : boolean +>test : (x: boolean) => boolean +>state as any && state : any +>state as any : any +>state : true +>state : true + + test(state as any && state); +>test(state as any && state) : boolean +>test : (x: boolean) => boolean +>state as any && state : any +>state as any : any +>state : true +>state : true + + test(state as any && state); +>test(state as any && state) : boolean +>test : (x: boolean) => boolean +>state as any && state : any +>state as any : any +>state : true +>state : true +} + diff --git a/tests/cases/compiler/controlFlowManyCallExpressionStatementsPerf.ts b/tests/cases/compiler/controlFlowManyCallExpressionStatementsPerf.ts new file mode 100644 index 0000000000000..670f8c05d16a7 --- /dev/null +++ b/tests/cases/compiler/controlFlowManyCallExpressionStatementsPerf.ts @@ -0,0 +1,64 @@ +// @strict: true + +function test(x: boolean): boolean { return x; } + +let state = true; + +if (state) { + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); + test(state as any && state); +}