mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-19 01:33:15 -05:00
Discard union types before considering weak type checks on unit-like types (#50423)
* Only check isUnitType when dealing with non-unions. * Add test case. * Accepted baselines.
This commit is contained in:
committed by
GitHub
parent
b9a5bbc9af
commit
fb717df6bf
@@ -18901,7 +18901,7 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
const isPerformingCommonPropertyChecks = (relation !== comparableRelation || relation === comparableRelation && isLiteralType(source)) &&
|
||||
const isPerformingCommonPropertyChecks = (relation !== comparableRelation || !(source.flags & TypeFlags.Union) && isLiteralType(source)) &&
|
||||
!(intersectionState & IntersectionState.Target) &&
|
||||
source.flags & (TypeFlags.Primitive | TypeFlags.Object | TypeFlags.Intersection) && source !== globalObjectType &&
|
||||
target.flags & (TypeFlags.Object | TypeFlags.Intersection) && isWeakType(target) &&
|
||||
|
||||
Reference in New Issue
Block a user