File tree Expand file tree Collapse file tree 2 files changed +1
-14
lines changed Expand file tree Collapse file tree 2 files changed +1
-14
lines changed Original file line number Diff line number Diff line change @@ -3882,18 +3882,7 @@ module ts {
3882
3882
}
3883
3883
3884
3884
function instantiateAnonymousType(type: ObjectType, mapper: TypeMapper): ObjectType {
3885
- // If this type has already been instantiated using this mapper, returned the cached result. This guards against
3886
- // infinite instantiations of cyclic types, e.g. "var x: { a: T, b: typeof x };"
3887
- if (mapper.mappings) {
3888
- let cached = <ObjectType>mapper.mappings[type.id];
3889
- if (cached) {
3890
- return cached;
3891
- }
3892
- }
3893
- else {
3894
- mapper.mappings = {};
3895
- }
3896
- // Instantiate the given type using the given mapper and cache the result
3885
+ // Mark the anonymous type as instantiated such that our infinite instantiation detection logic can recognize it
3897
3886
let result = <ResolvedType>createObjectType(TypeFlags.Anonymous | TypeFlags.Instantiated, type.symbol);
3898
3887
result.properties = instantiateList(getPropertiesOfObjectType(type), mapper, instantiateSymbol);
3899
3888
result.members = createSymbolTable(result.properties);
@@ -3903,7 +3892,6 @@ module ts {
3903
3892
let numberIndexType = getIndexTypeOfType(type, IndexKind.Number);
3904
3893
if (stringIndexType) result.stringIndexType = instantiateType(stringIndexType, mapper);
3905
3894
if (numberIndexType) result.numberIndexType = instantiateType(numberIndexType, mapper);
3906
- mapper.mappings[type.id] = result;
3907
3895
return result;
3908
3896
}
3909
3897
Original file line number Diff line number Diff line change @@ -1730,7 +1730,6 @@ module ts {
1730
1730
/* @internal */
1731
1731
export interface TypeMapper {
1732
1732
( t : TypeParameter ) : Type ;
1733
- mappings ?: Map < Type > ; // Type mapping cache
1734
1733
}
1735
1734
1736
1735
/* @internal */
You can’t perform that action at this time.
0 commit comments