Skip to content

Commit a7b4635

Browse files
authored
Add object check to justify cast (#27576)
1 parent 4ad6541 commit a7b4635

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/compiler/checker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10619,7 +10619,7 @@ namespace ts {
1061910619
target.flags & TypeFlags.Union ? some((<UnionType>target).types, t => isTypeDerivedFrom(source, t)) :
1062010620
source.flags & TypeFlags.InstantiableNonPrimitive ? isTypeDerivedFrom(getBaseConstraintOfType(source) || emptyObjectType, target) :
1062110621
target === globalObjectType ? !!(source.flags & (TypeFlags.Object | TypeFlags.NonPrimitive)) :
10622-
target === globalFunctionType ? isFunctionObjectType(source as ObjectType) :
10622+
target === globalFunctionType ? !!(source.flags & TypeFlags.Object) && isFunctionObjectType(source as ObjectType) :
1062310623
hasBaseType(source, getTargetType(target));
1062410624
}
1062510625

0 commit comments

Comments
 (0)