Skip to content

Try to resolve module before checking imports#20691

Closed
srolel wants to merge 1 commit into
microsoft:masterfrom
srolel:master
Closed

Try to resolve module before checking imports#20691
srolel wants to merge 1 commit into
microsoft:masterfrom
srolel:master

Conversation

@srolel

@srolel srolel commented Dec 14, 2017

Copy link
Copy Markdown
Contributor

Fixes #20576

Use-case 1:

import "./foo";

No importClause.name nor importClause.namedBindings, no branch is reached that tries to resolve the module.

Use-case 2:

import {} from "./foo";

No importClause.name, has importClause.namedBindings but it's empty, no branch is reached that tries to resolve the module.

Notes:

  1. The only test changed is what seems to have been a false positive.
  2. Other tests have their baseline updated, as all new errors thrown are valid and correct, without impairing the underlying test cases as far as I can tell
  3. Although the in the issue it is stated use-case 1 is handled correctly by emitting an error, I confirmed in both 2.6.2 and 2.7.0-dev.20171213 that it is not the case.

@srolel

srolel commented Dec 14, 2017

Copy link
Copy Markdown
Contributor Author

I missed the other PR opened for this issue. I'll leave this open for now because of the additional use-case fix.

@typescript-bot

typescript-bot commented Jun 12, 2018

Copy link
Copy Markdown
Contributor

Thanks for your contribution. This PR has not been updated in a while and cannot be automatically merged at the time being. For housekeeping purposes we are closing stale PRs. If you'd still like to continue working on this PR, please leave a message and one of the maintainers can reopen it.

@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Typescript compiler doesn't fail when importing {} from a module that doesn't exist

2 participants