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
In `function (): object {...}` object is a predefined type, but
in `function (object: any): object is foo{}` object is now
a regular identifier. The previous grammar was not able
to parse the second example, probably because when the parsers
sees the second ':' for the return type, the contextual lexual
does not know yet if it's a type predicate or predefined type, so
it accepts 'object' as a predefined type and only fail later when
it sees 'is'.
test plan:
I tried in astexplorer.net and the second example is valid typescript
code (sadly).
0 commit comments