mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-08 12:55:49 -05:00
Merge pull request #15257 from Microsoft/unknown-properties-are-assignable-to-Object-in-union
Unknown properties are assignable to `Object` in union
This commit is contained in:
@@ -8708,7 +8708,7 @@ namespace ts {
|
||||
if (maybeTypeOfKind(target, TypeFlags.Object) && !(getObjectFlags(target) & ObjectFlags.ObjectLiteralPatternWithComputedProperties)) {
|
||||
const isComparingJsxAttributes = !!(source.flags & TypeFlags.JsxAttributes);
|
||||
if ((relation === assignableRelation || relation === comparableRelation) &&
|
||||
(target === globalObjectType || (!isComparingJsxAttributes && isEmptyObjectType(target)))) {
|
||||
(isTypeSubsetOf(globalObjectType, target) || (!isComparingJsxAttributes && isEmptyObjectType(target)))) {
|
||||
return false;
|
||||
}
|
||||
for (const prop of getPropertiesOfObjectType(source)) {
|
||||
|
||||
Reference in New Issue
Block a user