-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issueRescheduledThis issue was previously scheduled to an earlier milestoneThis issue was previously scheduled to an earlier milestone
Milestone
Description
Follow-up to #40513, which surfaced an example of export duplicates that should be allowed:
exports.x = undefined
function x() { }
exports.x = x
This pattern is used in the async package's index.js.
Expected behavior:
No error; TS' emit uses this pattern too.
Actual behavior:
Error: "Cannot redeclare exported variable 'x'."
Currently commonjs exports use excludeFlags of SymbolFlags.None instead of SymbolFlags.Alias as normal aliases do. However, most duplicate alias detection happens in the checker already. All exports should switch to None instead of Alias, and then the above undefined
exception can be added in one place in the checker.
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issueRescheduledThis issue was previously scheduled to an earlier milestoneThis issue was previously scheduled to an earlier milestone