You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
const result = forEachSymbolTableInScope(enclosingDeclaration, getAccessibleSymbolChainFromSymbolTable);
4013
+
cache.set(key, result);
4014
+
return result;
4005
4015
4006
4016
/**
4007
4017
* @param {ignoreQualification} boolean Set when a symbol is being looked for through the exports of another symbol (meaning we have a route to qualify it already)
@@ -5814,7 +5824,7 @@ namespace ts {
5814
5824
}
5815
5825
if (context.flags & NodeBuilderFlags.GenerateNamesForShadowedTypeParams) {
5816
5826
const rawtext = result.escapedText as string;
5817
-
let i = 0;
5827
+
let i = context.typeParameterNamesByTextNextNameCount?.get(rawtext) || 0;
5818
5828
let text = rawtext;
5819
5829
while (context.typeParameterNamesByText?.has(text) || typeParameterShadowsNameInScope(text as __String, context, type)) {
5820
5830
i++;
@@ -5823,8 +5833,11 @@ namespace ts {
5823
5833
if (text !== rawtext) {
5824
5834
result = factory.createIdentifier(text, result.typeArguments);
5825
5835
}
5826
-
(context.typeParameterNames || (context.typeParameterNames = new Map())).set(getTypeId(type), result);
5827
-
(context.typeParameterNamesByText || (context.typeParameterNamesByText = new Set())).add(result.escapedText as string);
5836
+
// avoiding iterations of the above loop turns out to be worth it when `i` starts to get large, so we cache the max
5837
+
// `i` we've used thus far, to save work later
5838
+
(context.typeParameterNamesByTextNextNameCount ||= new Map()).set(rawtext, i);
5839
+
(context.typeParameterNames ||= new Map()).set(getTypeId(type), result);
5840
+
(context.typeParameterNamesByText ||= new Set()).add(result.escapedText as string);
Copy file name to clipboardExpand all lines: src/compiler/types.ts
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -4831,6 +4831,7 @@ namespace ts {
4831
4831
typeOnlyDeclaration?: TypeOnlyCompatibleAliasDeclaration|false;// First resolved alias declaration that makes the symbol only usable in type constructs
4832
4832
isConstructorDeclaredProperty?: boolean;// Property declared through 'this.x = ...' assignment in constructor
4833
4833
tupleLabelDeclaration?: NamedTupleMember|ParameterDeclaration;// Declaration associated with the tuple's label
tests/cases/compiler/Api.ts(6,5): error TS7056: The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed.
2
+
tests/cases/compiler/Api.ts(7,5): error TS7056: The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed.
3
+
tests/cases/compiler/Api.ts(8,5): error TS7056: The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed.
0 commit comments