Make the relationship between partial mapped types and the empty object not apply for subtype relationship (#29384)

This commit is contained in:
Wesley Wigham
2019-01-17 15:42:58 -08:00
committed by GitHub
parent b6ae492009
commit addeff325b
5 changed files with 170 additions and 1 deletions

View File

@@ -12677,7 +12677,7 @@ namespace ts {
}
else {
// An empty object type is related to any mapped type that includes a '?' modifier.
if (isPartialMappedType(target) && isEmptyObjectType(source)) {
if (relation !== subtypeRelation && isPartialMappedType(target) && isEmptyObjectType(source)) {
return Ternary.True;
}
if (isGenericMappedType(target)) {