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
This is a consequence of how we parse source files and determine whether they are a Module or a Script based on the presence or absence of import or export declarations. According to the TLA proposal, await is now treated like a keyword at the top level of a Module, but not a Script. The fact that await p (without parens) works at the top level currently is actually due to the fact we would parse it as an AwaitExpression for error reporting purposes (and still do for await in a normal function).
To address this, we will likely need to "reparse" a function call whose expression is an await and replace it with an AwaitExpression in any top-level position.
TypeScript Version: 3.8.1-rc
Search Terms:
Code
Expected behavior:
no error on the
await
wordActual behavior:
TS thinks it is an identifier.
Playground Link:
Playground link
Related Issues:
#35276
The text was updated successfully, but these errors were encountered: