-
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
Add missed resolveSymbol in commonjs import resolution #41479
Conversation
Fixes resolution of export aliases in the postfix-property-access case of commonjs require: ```js const { x } = require('./foo').nested x ``` This program would previously fail if `x` was an export alias. Fixes #41422
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.
Is this all we were missing? clicks tongue man, if only we could track the alias-resolution state of a symbol in the type system and assert it at certain points; because I've fixed a couple other bugs in the same way this cycle.
Yep, there are a set of Functions You Should Call on all resolved symbols, and they're not at all enforced. |
@typescript-bot cherry pick this to release-4.1 Open to hearing reasons why this isn’t a strong candidate to backport to a patch release, but the fix seems simple and innocuous and the bug seems pretty bad if you hit it, though I don’t expect to many people will. But at least one did: #41629 |
@typescript-bot cherry-pick this to release-4.1 Does cherry-pick have to be hyphenated? |
Heya @andrewbranch, I've started to run the task to cherry-pick this into |
Hey @andrewbranch, I couldn't open a PR with the cherry-pick. (You can check the log here). You may need to squash and pick this PR into release-4.1 manually. |
Fixes resolution of export aliases in the postfix-property-access case of commonjs require: ```js const { x } = require('./foo').nested x ``` This program would previously fail if `x` was an export alias. Fixes microsoft#41422
Fixes resolution of export aliases in the postfix-property-access case of commonjs require: ```js const { x } = require('./foo').nested x ``` This program would previously fail if `x` was an export alias. Fixes #41422 Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
Fixes resolution of export aliases in the postfix-property-access case
of commonjs require:
This program would previously fail if
x
was an export alias.Fixes #41422