Fix check in isMappedTypeGenericIndexedAccess (#49341)

* Fix check in isMappedTypeGenericIndexedAccess

* Add regression tests
This commit is contained in:
Anders Hejlsberg
2022-06-01 10:01:56 -07:00
committed by GitHub
parent 9031497b92
commit 1beb1037c0
5 changed files with 449 additions and 1 deletions

View File

@@ -12308,7 +12308,7 @@ namespace ts {
let objectType;
return !!(type.flags & TypeFlags.IndexedAccess && getObjectFlags(objectType = (type as IndexedAccessType).objectType) & ObjectFlags.Mapped &&
!isGenericMappedType(objectType) && isGenericIndexType((type as IndexedAccessType).indexType) &&
!(objectType as MappedType).declaration.questionToken && !(objectType as MappedType).declaration.nameType);
!(getMappedTypeModifiers(objectType as MappedType) & MappedTypeModifiers.ExcludeOptional) && !(objectType as MappedType).declaration.nameType);
}
/**