File tree 1 file changed +3
-1
lines changed 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -8571,14 +8571,16 @@ namespace ts {
8571
8571
// An object type S is considered to be derived from an object type T if
8572
8572
// S is a union type and every constituent of S is derived from T,
8573
8573
// T is a union type and S is derived from at least one constituent of T, or
8574
+ // T is one of the global types Object and Function and S is a subtype of T, or
8574
8575
// T occurs directly or indirectly in an 'extends' clause of S.
8575
8576
// Note that this check ignores type parameters and only considers the
8576
8577
// inheritance hierarchy.
8577
8578
function isTypeDerivedFrom(source: Type, target: Type): boolean {
8578
8579
return source.flags & TypeFlags.Union ? every((<UnionType>source).types, t => isTypeDerivedFrom(t, target)) :
8579
8580
target.flags & TypeFlags.Union ? some((<UnionType>target).types, t => isTypeDerivedFrom(source, t)) :
8581
+ target === globalObjectType || target === globalFunctionType ? isTypeSubtypeOf(source, target) :
8580
8582
hasBaseType(source, getTargetType(target));
8581
- }
8583
+ }
8582
8584
8583
8585
/**
8584
8586
* This is *not* a bi-directional relationship.
You can’t perform that action at this time.
0 commit comments