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

swc: Type-only import left in JS emit #10462

Closed
nayeemrmn opened this issue May 1, 2021 · 2 comments
Closed

swc: Type-only import left in JS emit #10462

nayeemrmn opened this issue May 1, 2021 · 2 comments
Labels
bug Something isn't working correctly fix available there is a fix available in a third party library that needs to be merged swc related to swc (bundling/transpiling)

Comments

@nayeemrmn
Copy link
Collaborator

temp.ts:

import { foo } from "./temp2.ts"; // This import statement is wrongly left in the emit.

const _: foo = null;
console.log({ foo: 1 }); // This usage of the name `foo` wrongly counts as a value-usage of the imported `foo`.

temp2.ts:

export type foo = unknown;

cc @kdy1

kdy1 added a commit to kdy1/swc that referenced this issue May 3, 2021
kdy1 added a commit to kdy1/swc that referenced this issue May 3, 2021
kdy1 added a commit to swc-project/swc that referenced this issue May 3, 2021
swc_ecma_transforms_typescript:
 - Fix import analyzer. (denoland/deno#10462)
@kdy1
Copy link

kdy1 commented May 3, 2021

Fixed on the upstream.

@lucacasonato lucacasonato added bug Something isn't working correctly swc related to swc (bundling/transpiling) fix available there is a fix available in a third party library that needs to be merged labels May 4, 2021
@nayeemrmn
Copy link
Collaborator Author

Fixed by #10559.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly fix available there is a fix available in a third party library that needs to be merged swc related to swc (bundling/transpiling)
Projects
None yet
Development

No branches or pull requests

3 participants