Skip to content

Commit 93c0f0c

Browse files
committed
isEmptyObjectType should check that argument is not generic mapped type
1 parent 4d74f67 commit 93c0f0c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/compiler/checker.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11386,7 +11386,7 @@ namespace ts {
1138611386
}
1138711387

1138811388
function isEmptyObjectType(type: Type): boolean {
11389-
return type.flags & TypeFlags.Object ? isEmptyResolvedType(resolveStructuredTypeMembers(<ObjectType>type)) :
11389+
return type.flags & TypeFlags.Object ? !isGenericMappedType(type) && isEmptyResolvedType(resolveStructuredTypeMembers(<ObjectType>type)) :
1139011390
type.flags & TypeFlags.NonPrimitive ? true :
1139111391
type.flags & TypeFlags.Union ? some((<UnionType>type).types, isEmptyObjectType) :
1139211392
type.flags & TypeFlags.Intersection ? every((<UnionType>type).types, isEmptyObjectType) :
@@ -12361,7 +12361,7 @@ namespace ts {
1236112361
}
1236212362
else {
1236312363
// An empty object type is related to any mapped type that includes a '?' modifier.
12364-
if (isPartialMappedType(target) && !isGenericMappedType(source) && isEmptyObjectType(source)) {
12364+
if (isPartialMappedType(target) && isEmptyObjectType(source)) {
1236512365
return Ternary.True;
1236612366
}
1236712367
if (isGenericMappedType(target)) {

0 commit comments

Comments
 (0)