diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 4fdc8b7f3f017..8188e14f5c898 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -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); } /**