@@ -9427,7 +9427,7 @@ namespace ts {
9427
9427
function hasCommonProperties(source: Type, target: Type) {
9428
9428
const isComparingJsxAttributes = !!(source.flags & TypeFlags.JsxAttributes);
9429
9429
for (const prop of getPropertiesOfType(source)) {
9430
- if (isKnownProperty(target, prop.name, isComparingJsxAttributes)) {
9430
+ if (isKnownProperty(target, prop.name, isComparingJsxAttributes, /*skipGlobalObject*/ true )) {
9431
9431
return true;
9432
9432
}
9433
9433
}
@@ -14221,12 +14221,12 @@ namespace ts {
14221
14221
* @param name a property name to search
14222
14222
* @param isComparingJsxAttributes a boolean flag indicating whether we are searching in JsxAttributesType
14223
14223
*/
14224
- function isKnownProperty(targetType: Type, name: string, isComparingJsxAttributes: boolean): boolean {
14224
+ function isKnownProperty(targetType: Type, name: string, isComparingJsxAttributes: boolean, skipGlobalObject?: boolean ): boolean {
14225
14225
if (targetType.flags & TypeFlags.Object) {
14226
14226
const resolved = resolveStructuredTypeMembers(<ObjectType>targetType);
14227
14227
if (resolved.stringIndexInfo ||
14228
14228
resolved.numberIndexInfo && isNumericLiteralName(name) ||
14229
- getPropertyOfType(targetType, name) ||
14229
+ (skipGlobalObject ? getPropertyOfObjectType(targetType, name) : getPropertyOfType(targetType, name) ) ||
14230
14230
isComparingJsxAttributes && !isUnhyphenatedJsxName(name)) {
14231
14231
// For JSXAttributes, if the attribute has a hyphenated name, consider that the attribute to be known.
14232
14232
return true;
0 commit comments