function foo(x: number | string) {
if (x instanceof Number) {
x
}
}
Expected:
The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter
Actual:
No error, incorrect narrowing behavior (#14426)
Edit: Corrected the example to actually be a union.