Skip to content

do not report use-before-declaration error in async IIFE initializer #50199

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

Merged
merged 1 commit into from
Nov 2, 2022

Conversation

Zzzen
Copy link
Contributor

@Zzzen Zzzen commented Aug 5, 2022

Fixes #50123

@typescript-bot typescript-bot added the For Backlog Bug PRs that fix a backlog bug label Aug 5, 2022
Copy link
Member

@gabritto gabritto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! ✨

@gabritto
Copy link
Member

Worth noting here that, as discussed in the original issue (#50123 (comment)), with this fix we will now allow (valid) cases like:

const promise = (async () => {
  await foo();
  promise;
})()

but also invalid ones like:

const promise = (async () => {
  promise;
  await foo();
})()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Backlog Bug PRs that fix a backlog bug
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Incorrect use-before-declaration error in async IIFE initializer
4 participants