Skip to content

mergeSymbol in checker:Remove block-scoped duplicate declaration errors in plain JS #47825

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 2 commits into from
Feb 10, 2022

Conversation

sandersn
Copy link
Member

@sandersn sandersn commented Feb 9, 2022

Previously they were issued in mergeSymbol, now they are not issued.

Previously they were issued in mergeSymbol, not they are not issued.
@typescript-bot typescript-bot added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Feb 9, 2022
@sandersn sandersn changed the title Checker:Remove block-scoped duplicate declaration errors in plain JS mergeSymbol in checker:Remove block-scoped duplicate declaration errors in plain JS Feb 9, 2022
Comment on lines +1341 to +1342
if (!isSourcePlainJs) addDuplicateLocations(conflictingSymbolInfo.firstFileLocations, source);
if (!isTargetPlainJs) addDuplicateLocations(conflictingSymbolInfo.secondFileLocations, target);
Copy link
Member

Choose a reason for hiding this comment

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

Definitely weird - if you get one in one file, it's helpful to know where the other is. But you can always find-all-references I suppose.

Copy link
Member Author

@sandersn sandersn Feb 9, 2022

Choose a reason for hiding this comment

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

I'm trying to imitate the existing post-compile filtration of JS errors, which behaves the same way. It's definitely not ideal.

Edit: Actually, this maintains the pre-4.6 behaviour if you have a global const in a TS file and a global const in a JS file. The latter will not report the error, the former will.

@sandersn sandersn merged commit 42aa18b into main Feb 10, 2022
@sandersn sandersn deleted the remove-block-scoped-global-merge-errors branch February 10, 2022 00:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants