File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed
Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -20374,16 +20374,16 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
2037420374 error(currentNode, Diagnostics.Type_instantiation_is_excessively_deep_and_possibly_infinite);
2037520375 return errorType;
2037620376 }
20377- mapper.instantiations ??= new Map( );
20378- const cached = mapper.instantiations.get(type.id );
20377+ const key = type.id + getAliasId(aliasSymbol, aliasTypeArguments );
20378+ const cached = ( mapper.instantiations ??= new Map()) .get(key );
2037920379 if (cached) {
2038020380 return cached;
2038120381 }
2038220382 totalInstantiationCount++;
2038320383 instantiationCount++;
2038420384 instantiationDepth++;
2038520385 const result = instantiateTypeWorker(type, mapper, aliasSymbol, aliasTypeArguments);
20386- mapper.instantiations.set(type.id , result);
20386+ mapper.instantiations.set(key , result);
2038720387 instantiationDepth--;
2038820388 return result;
2038920389 }
Original file line number Diff line number Diff line change @@ -7029,11 +7029,11 @@ export const enum TypeMapKind {
70297029
70307030/** @internal */
70317031export type TypeMapper =
7032- | { kind : TypeMapKind . Simple ; source : Type ; target : Type ; instantiations ?: Map < TypeId , Type > ; }
7033- | { kind : TypeMapKind . Array ; sources : readonly Type [ ] ; targets : readonly Type [ ] | undefined ; instantiations ?: Map < TypeId , Type > ; }
7034- | { kind : TypeMapKind . Deferred ; sources : readonly Type [ ] ; targets : ( ( ) => Type ) [ ] ; instantiations ?: Map < TypeId , Type > ; }
7035- | { kind : TypeMapKind . Function ; func : ( t : Type ) => Type ; debugInfo ?: ( ) => string ; instantiations ?: Map < TypeId , Type > ; }
7036- | { kind : TypeMapKind . Composite | TypeMapKind . Merged ; mapper1 : TypeMapper ; mapper2 : TypeMapper ; instantiations ?: Map < TypeId , Type > ; } ;
7032+ | { kind : TypeMapKind . Simple ; source : Type ; target : Type ; instantiations ?: Map < string , Type > ; }
7033+ | { kind : TypeMapKind . Array ; sources : readonly Type [ ] ; targets : readonly Type [ ] | undefined ; instantiations ?: Map < string , Type > ; }
7034+ | { kind : TypeMapKind . Deferred ; sources : readonly Type [ ] ; targets : ( ( ) => Type ) [ ] ; instantiations ?: Map < string , Type > ; }
7035+ | { kind : TypeMapKind . Function ; func : ( t : Type ) => Type ; debugInfo ?: ( ) => string ; instantiations ?: Map < string , Type > ; }
7036+ | { kind : TypeMapKind . Composite | TypeMapKind . Merged ; mapper1 : TypeMapper ; mapper2 : TypeMapper ; instantiations ?: Map < string , Type > ; } ;
70377037
70387038// dprint-ignore
70397039export const enum InferencePriority {
You can’t perform that action at this time.
0 commit comments