Skip to content

Conversation

@ZYSzys
Copy link
Contributor

@ZYSzys ZYSzys commented May 30, 2021

Fixes #44267

@typescript-bot typescript-bot added the For Backlog Bug PRs that fix a backlog bug label May 30, 2021
const namespaceNameConflicts = toConvert.elements.some(element =>
FindAllReferences.Core.eachSymbolReferenceInFile(element.name, checker, sourceFile, id =>
!!checker.resolveName(preferredName, id, SymbolFlags.All, /*excludeGlobals*/ true)) || false);
!!checker.resolveName(preferredName, id, SymbolFlags.All, /*excludeGlobals*/ true) && checker.getSymbolAtLocation(element.name) !== checker.getSymbolAtLocation(id)) || false);
Copy link
Member

@andrewbranch andrewbranch Jun 9, 2021

Choose a reason for hiding this comment

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

I don’t immediately understand how checker.getSymbolAtLocation(element.name) !== checker.getSymbolAtLocation(id) could ever be true if id is supposed to be a symbol reference to element.name 🤔 Can you give a brief explanation of how a real naming conflict detection works now that this condition is added?

@gabritto
Copy link
Member

Thanks for your contribution. I investigated the related issue and came up with a fix PR that I think addresses with more special cases (#45019), so I will close this PR now, but we appreciate your contribution.

@gabritto gabritto closed this Jul 14, 2021
@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

For Backlog Bug PRs that fix a backlog bug

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

"Convert named imports to namespace import" adds redundant underscore suffix

5 participants