Skip to content

Commit e47df36

Browse files
committed
Use isTypeAny instead of checking flags directly
1 parent e494d73 commit e47df36

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
@@ -17148,7 +17148,7 @@ namespace ts {
1714817148
// and the right operand to be of type Any, a subtype of the 'Function' interface type, or have a call or construct signature.
1714917149
// The result is always of the Boolean primitive type.
1715017150
// NOTE: do not raise error if leftType is unknown as related error was already reported
17151-
if (!(leftType.flags & TypeFlags.Any) && isTypeAssignableToKind(leftType, TypeFlags.Primitive)) {
17151+
if (!isTypeAny(leftType) && isTypeAssignableToKind(leftType, TypeFlags.Primitive)) {
1715217152
error(left, Diagnostics.The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter);
1715317153
}
1715417154
// NOTE: do not raise error if right is unknown as related error was already reported

0 commit comments

Comments
 (0)