Instantiate original target type in substituteIndexedMappedType (#49205)

This commit is contained in:
Anders Hejlsberg authored and GitHub committed 2022-05-23 11:07:33 -07:00
1 parent 006ae339bf
commit c592ee781d
1 file changed
+1 -1
+1 -1
View File
@@ -15798,7 +15798,7 @@ namespace ts {
function substituteIndexedMappedType(objectType: MappedType, index: Type) {
const mapper = createTypeMapper([getTypeParameterFromMappedType(objectType)], [index]);
const templateMapper = combineTypeMappers(objectType.mapper, mapper);
return instantiateType(getTemplateTypeFromMappedType(objectType), templateMapper);
return instantiateType(getTemplateTypeFromMappedType(objectType.target as MappedType || objectType), templateMapper);
}
function getIndexedAccessType(objectType: Type, indexType: Type, accessFlags = AccessFlags.None, accessNode?: ElementAccessExpression | IndexedAccessTypeNode | PropertyName | BindingName | SyntheticExpression, aliasSymbol?: Symbol, aliasTypeArguments?: readonly Type[]): Type {