diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index dde8033d1e..e4ea3740a6 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -7640,11 +7640,11 @@ namespace ts { if (members.has(leftProp.name)) { const rightProp = members.get(leftProp.name); const rightType = getTypeOfSymbol(rightProp); - if (maybeTypeOfKind(rightType, TypeFlags.Undefined) || rightProp.flags & SymbolFlags.Optional) { + if (rightProp.flags & SymbolFlags.Optional) { const declarations: Declaration[] = concatenate(leftProp.declarations, rightProp.declarations); const flags = SymbolFlags.Property | (leftProp.flags & SymbolFlags.Optional); const result = createSymbol(flags, leftProp.name); - result.type = getUnionType([getTypeOfSymbol(leftProp), getTypeWithFacts(rightType, TypeFacts.NEUndefined)]); + result.type = getUnionType([getTypeOfSymbol(leftProp), rightType]); result.leftSpread = leftProp; result.rightSpread = rightProp; result.declarations = declarations;