-
Notifications
You must be signed in to change notification settings - Fork 12.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow of
in await using
declarations in for-of loops
#55558
Allow of
in await using
declarations in for-of loops
#55558
Conversation
7a75c09
to
7f15218
Compare
for await (await using of of of) {}; | ||
~~~~~ | ||
!!! error TS1431: 'for await' loops are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we put this in an async context, like an async function
so that we don't have this spurious error in errors.txt
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just pushed out the requested change. Could you take another look at this?
Note that 5.3 is cut; not sure if you intended for this to be in 5.3 or not. |
I did. This was a bugfix for a grammar error. |
await using
declarations in for-of loopsof
in await using
declarations in for-of loops
It was synced in after I commented, so nevermind! |
With this change, Was that an intentional aspect of this change or was that a regression? |
@evanw thanks for this information - I'll take a look at this soon. |
fixes #55555