mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-15 11:35:42 -06:00
Properly handle intersection types in getUnmatchedProperty
This commit is contained in:
parent
1a7a587a9e
commit
5b0bcecfae
@ -10792,7 +10792,7 @@ namespace ts {
|
||||
}
|
||||
|
||||
function getUnmatchedProperty(source: Type, target: Type, requireOptionalProperties: boolean) {
|
||||
const properties = getPropertiesOfObjectType(target);
|
||||
const properties = target.flags & TypeFlags.Intersection ? getPropertiesOfUnionOrIntersectionType(<IntersectionType>target) : getPropertiesOfObjectType(target);
|
||||
for (const targetProp of properties) {
|
||||
if (requireOptionalProperties || !(targetProp.flags & SymbolFlags.Optional)) {
|
||||
const sourceProp = getPropertyOfType(source, targetProp.escapedName);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user