@@ -14838,7 +14838,6 @@ namespace ts {
14838
14838
t.flags & TypeFlags.BigInt && includes & TypeFlags.BigIntLiteral ||
14839
14839
t.flags & TypeFlags.ESSymbol && includes & TypeFlags.UniqueESSymbol ||
14840
14840
t.flags & TypeFlags.Void && includes & TypeFlags.Undefined ||
14841
- t.flags & TypeFlags.NonPrimitive && includes & TypeFlags.Object ||
14842
14841
isEmptyAnonymousObjectType(t) && includes & TypeFlags.DefinitelyNonNullable;
14843
14842
if (remove) {
14844
14843
orderedRemoveItemAt(types, i);
@@ -15002,7 +15001,6 @@ namespace ts {
15002
15001
includes & TypeFlags.BigInt && includes & TypeFlags.BigIntLiteral ||
15003
15002
includes & TypeFlags.ESSymbol && includes & TypeFlags.UniqueESSymbol ||
15004
15003
includes & TypeFlags.Void && includes & TypeFlags.Undefined ||
15005
- includes & TypeFlags.NonPrimitive && includes & TypeFlags.Object ||
15006
15004
includes & TypeFlags.IncludesEmptyObject && includes & TypeFlags.DefinitelyNonNullable) {
15007
15005
removeRedundantSupertypes(typeSet, includes);
15008
15006
}
@@ -25061,9 +25059,12 @@ namespace ts {
25061
25059
if (!areTypesComparable(t, c)) {
25062
25060
return neverType;
25063
25061
}
25064
- if (( c.flags & TypeFlags.Primitive) && t.flags & TypeFlags.Object && !isEmptyAnonymousObjectType(t)) {
25062
+ if (c.flags & TypeFlags.Primitive && t.flags & TypeFlags.Object && !isEmptyAnonymousObjectType(t)) {
25065
25063
return isTypeSubtypeOf(c, t) ? c : neverType;
25066
25064
}
25065
+ if (c === globalFunctionType && t.flags & TypeFlags.NonPrimitive) {
25066
+ return c;
25067
+ }
25067
25068
return getIntersectionType([t, c]);
25068
25069
});
25069
25070
});
0 commit comments