mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-05 08:11:30 -06:00
isEmptyObjectType should check that argument is not generic mapped type
This commit is contained in:
parent
4d74f67325
commit
93c0f0ca0f
@ -11386,7 +11386,7 @@ namespace ts {
|
||||
}
|
||||
|
||||
function isEmptyObjectType(type: Type): boolean {
|
||||
return type.flags & TypeFlags.Object ? isEmptyResolvedType(resolveStructuredTypeMembers(<ObjectType>type)) :
|
||||
return type.flags & TypeFlags.Object ? !isGenericMappedType(type) && isEmptyResolvedType(resolveStructuredTypeMembers(<ObjectType>type)) :
|
||||
type.flags & TypeFlags.NonPrimitive ? true :
|
||||
type.flags & TypeFlags.Union ? some((<UnionType>type).types, isEmptyObjectType) :
|
||||
type.flags & TypeFlags.Intersection ? every((<UnionType>type).types, isEmptyObjectType) :
|
||||
@ -12361,7 +12361,7 @@ namespace ts {
|
||||
}
|
||||
else {
|
||||
// An empty object type is related to any mapped type that includes a '?' modifier.
|
||||
if (isPartialMappedType(target) && !isGenericMappedType(source) && isEmptyObjectType(source)) {
|
||||
if (isPartialMappedType(target) && isEmptyObjectType(source)) {
|
||||
return Ternary.True;
|
||||
}
|
||||
if (isGenericMappedType(target)) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user