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

fix(es/transform_typescript): should consider A as a type in export { type A } #7196

Merged
merged 1 commit into from
Apr 4, 2023

Conversation

hyf0
Copy link
Contributor

@hyf0 hyf0 commented Apr 3, 2023

Description:

Fixes #7076.

BREAKING CHANGE:

Related issue (if exists):

if let ModuleExportName::Ident(local_ident) = &n.orig {
// If the stored exported `Id` is a value, we just leave it here.
// If the stored exported `Id` is both a type and value, we consider it's a
// value. See https://github.com/denoland/deno/issues/8978
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought this was easy but not easy as I thought when I met denoland/deno#8978.

Copy link
Member

@kdy1 kdy1 left a comment

Choose a reason for hiding this comment

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

Thanks!


swc-bump:

  • swc_ecma_transforms_typescript

@kdy1 kdy1 enabled auto-merge (squash) April 4, 2023 01:47
@kdy1 kdy1 added this to the Planned milestone Apr 4, 2023
@kdy1 kdy1 merged commit ddfbc93 into swc-project:main Apr 4, 2023
@magic-akari
Copy link
Member

I believe this may not be a correct fix. You should add the following test case.

import { A } from "./a.ts";
new A();
export { type A };

@hyf0
Copy link
Contributor Author

hyf0 commented Apr 4, 2023

I believe this may not be a correct fix. You should add the following test case.

import { A } from "./a.ts";
new A();
export { type A };

Good catch! There is still a lot to learn to me. I'll continue the fix weekend and if you want to take this, be my guest.

@kdy1 kdy1 modified the milestones: Planned, v1.3.45 Apr 4, 2023
kdy1 added a commit to kdy1/swc that referenced this pull request Apr 29, 2023
kdy1 added a commit that referenced this pull request Apr 29, 2023
@swc-project swc-project locked as resolved and limited conversation to collaborators May 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

export { type <ident> } does not result in <ident> being marked as a type
3 participants