mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-18 07:29:16 -05:00
Properly reduce intersections to never in identity relation (#48111)
* Exclude types that may simplify to other forms * Add regression test
This commit is contained in:
@@ -18104,7 +18104,8 @@ namespace ts {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
else if (!((source.flags | target.flags) & (TypeFlags.UnionOrIntersection | TypeFlags.IndexedAccess | TypeFlags.Conditional | TypeFlags.Substitution))) {
|
||||
// We have excluded types that may simplify to other forms, so types must have identical flags
|
||||
if (source.flags !== target.flags) return false;
|
||||
if (source.flags & TypeFlags.Singleton) return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user