File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8571,14 +8571,16 @@ namespace ts {
85718571 // An object type S is considered to be derived from an object type T if
85728572 // S is a union type and every constituent of S is derived from T,
85738573 // 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
85748575 // T occurs directly or indirectly in an 'extends' clause of S.
85758576 // Note that this check ignores type parameters and only considers the
85768577 // inheritance hierarchy.
85778578 function isTypeDerivedFrom(source: Type, target: Type): boolean {
85788579 return source.flags & TypeFlags.Union ? every((<UnionType>source).types, t => isTypeDerivedFrom(t, target)) :
85798580 target.flags & TypeFlags.Union ? some((<UnionType>target).types, t => isTypeDerivedFrom(source, t)) :
8581+ target === globalObjectType || target === globalFunctionType ? isTypeSubtypeOf(source, target) :
85808582 hasBaseType(source, getTargetType(target));
8581- }
8583+ }
85828584
85838585 /**
85848586 * This is *not* a bi-directional relationship.
You can’t perform that action at this time.
0 commit comments