π Search Terms
in:title instanceof
π Version & Regression Information
β― Playground Link
https://www.typescriptlang.org/play/?#code/IwAglgdgzgLghhAxgUwPYDMQG8QG0DKAngLYBGqANgHQAWcUAktPEsgLoAUAlNiAE7IYAVz4QQMPkOQgAvjICwAKAD0ykAD0QAFRrSKydDAC0dCABMQUMGekYQCEAHJIsBCgyOQyAB4AHAVBWqGLEQrAgpLaYMIS+0o4IhI4ANPZiqKQAVsiIMOKxtnz2+XEgvnB8cMSCyHxUHABMAMwArAAcXEA
π» Code
1 instanceof { [Symbol.hasInstance]() { return true }}
π Actual behavior
Error: The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter.(2358)
π Expected behavior
No errors
Additional information about the issue
For custom 'Symbol.hasInstance' methods, number instanceof obj can return true or false according to implementation.