mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-16 07:13:45 -05:00
Use bidirectional comparability in narrowing (#50592)
* Use bidirectional comparability (aka comparability) in narrowing * Rename test, check other CFA branch, test without strictNullChecks
This commit is contained in:
@@ -25096,7 +25096,7 @@ namespace ts {
|
||||
const narrowedPropType = narrowType(propType);
|
||||
return filterType(type, t => {
|
||||
const discriminantType = getTypeOfPropertyOrIndexSignature(t, propName);
|
||||
return !(narrowedPropType.flags & TypeFlags.Never) && isTypeComparableTo(narrowedPropType, discriminantType);
|
||||
return !(narrowedPropType.flags & TypeFlags.Never) && areTypesComparable(narrowedPropType, discriminantType);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user