Skip to content
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

Don't report an error when accessing a name of a global block-scoped variable on globalThis outside of noImplicitAny #58990

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Andarist
Copy link
Contributor

fixes #58345

…variable on `globalThis` outside of `noImplicitAny`
@sandersn
Copy link
Member

Even though the bug is labelled Help Wanted, I didn't see a consensus on the change we should make here. So that's probably the first task.

Also, will this fix the bug for the person who filed it? I'm not sure whether restricting this change to noImplicitAny: false makes sense -- since it really is a circularity error. I personally think it should remain one, but you can make the case that removing it here is useful. (and in JS there is special-case code to ensure that this pattern does work).

@Andarist
Copy link
Contributor Author

It’s not a circularity. Block-scoped top-level variables define global variables but not globalThis properties (this is different from var)

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
Status: Waiting on reviewers
Development

Successfully merging this pull request may close these issues.

Error when accessing properties on globalThis with the same name of a global variable
4 participants