Skip to content
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

Add extra tests for type and value symbol merging #55387

Merged
merged 1 commit into from Aug 16, 2023

Conversation

Andarist
Copy link
Contributor

this (indirectly~) closes #10122 , the behavior itself was changed by #50853 and this PR just "documents" those cases

// @Filename: other.ts
export type A = string;
function A() {}
export { A };
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this resolves to a value in this situation so it's kinda equivalent to:

export type A = string;
export function A() {}

and this was always~ allowed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note that in the past this was considered to be ambiguous and one could get an error when writing code like this ("Individual declarations in merged declaration 'B' must be all exported or all local"). In the referenced issue it was observed that the variant with exported function declaration didn't report an error (at least back in 2016 :P). @DanielRosenwasser even stated that it should error. However, since the behavior was changed in 4.9 by #50853 I think that the proper resolution nowadays is to accept the new behavior and just commit those tests.

@typescript-bot typescript-bot added the For Backlog Bug PRs that fix a backlog bug label Aug 15, 2023
@sandersn sandersn added this to Not started in PR Backlog via automation Aug 16, 2023
@sandersn sandersn moved this from Not started to Waiting on reviewers in PR Backlog Aug 16, 2023
Copy link
Member

@weswigham weswigham left a comment

Choose a reason for hiding this comment

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

This is just a new test, so I see no reason not to merge~

PR Backlog automation moved this from Waiting on reviewers to Needs merge Aug 16, 2023
@DanielRosenwasser DanielRosenwasser merged commit 08b2566 into microsoft:main Aug 16, 2023
18 checks passed
PR Backlog automation moved this from Needs merge to Done Aug 16, 2023
snovader pushed a commit to mestro-se/TypeScript that referenced this pull request Sep 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Backlog Bug PRs that fix a backlog bug
Projects
PR Backlog
  
Done
Development

Successfully merging this pull request may close these issues.

Inconsistent multiple export behavior for functions vs vars
5 participants