You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Today the === pattern for type guards only supports the literal types. The supported pattern for type guarding function types is to use instanceof. So this does work:
Is this a bug?
...since the typeof a RegExp will be an object and
RegExp
is a type that lacks a call signature.It works fine when a user-defined type guard is used, which seems inconsistent:
Version: TypeScript 1.6
Discovered here.
The text was updated successfully, but these errors were encountered: