You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The reason will be displayed to describe this comment to others. Learn more.
All of the examples that are broken feel like they should be fixable; I know some of this I've tackled in typeToTypeNode, but the same strategies probably don't work in declaration emit. I'm fine reverting this so it doesn't go out incorrectly and we can try and tackle it another day.
This also partially reverts #41044 as it removes all removal; I was actually expecting this to have caused d.ts errors because #41044 also introduced an error for unused renamings... but that didn't happen?
All of the examples that are broken feel like they should be fixable; I know some of this I've tackled in typeToTypeNode, but the same strategies probably don't work in declaration emit. I'm fine reverting this so it doesn't go out incorrectly and we can try and tackle it another day.
The problems are not unsolvable for sure. Even in declaration emit I think we ca solve it. But the problem is that it will introduce a lot of perf cost. Seems like it's not worth the complexity. (I belatedly arrived at the same conclusion as @andrewbranch 😅)
This also partially reverts #41044 as it removes all removal; I was actually expecting this to have caused d.ts errors because #41044 also introduced an error for unused renamings... but that didn't happen?
The error for unused renames is still there. I did not remove it. It only seems to pop up on some kinds of declarations for example function types let o: ({n : a}: any) => void;
The reason will be displayed to describe this comment to others. Learn more.
The error for unused renames is still there. I did not remove it. It only seems to pop up on some kinds of declarations for example function types let o: ({n : a}: any) => void;
Yet, there's no error baseline. That being said, it looks like for declaration files we straight up skip checking the final list:
if (!node.isDeclarationFile) {
checkPotentialUncheckedRenamedBindingElementsInTypes();
}
So, I think everything is fine? (Other than that I don't think it makes any sense that we still collect potentialUnusedRenamedBindingElementsInTypes in declaration files only to not read them later, which is not new.)
After checking the above and noticing #41044 (comment) saying explicitly that this does not show in dts files, I'm now confident that this PR is working correctly.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Revert change that removes binding aliases from declaration files. Doing this correctly implies doing a lot more work than previously anticipated.
Fixes #56991
Fixes #56992