Merge pull request #21696 from Microsoft/fixMappedTypeWithSubstitution

Handle all instantiable non-primitive types in mapped types
This commit is contained in:
Anders Hejlsberg
2018-02-06 13:26:19 -08:00
committed by GitHub
6 changed files with 306 additions and 1 deletions

View File

@@ -8781,7 +8781,7 @@ namespace ts {
}
function isMappableType(type: Type) {
return type.flags & (TypeFlags.Any | TypeFlags.TypeParameter | TypeFlags.Object | TypeFlags.Intersection | TypeFlags.IndexedAccess);
return type.flags & (TypeFlags.Any | TypeFlags.InstantiableNonPrimitive | TypeFlags.Object | TypeFlags.Intersection);
}
function instantiateAnonymousType(type: AnonymousType, mapper: TypeMapper): AnonymousType {