Skip to content

Commit

Permalink
fix(es/codegen): Fix codegen of type args of an import type and a typ…
Browse files Browse the repository at this point in the history
…e query (#8296)
  • Loading branch information
dsherret committed Nov 16, 2023
1 parent c566b73 commit 369fb21
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
7 changes: 2 additions & 5 deletions crates/swc_ecma_codegen/src/typescript.rs
Expand Up @@ -852,11 +852,7 @@ where
emit!(n);
}

if let Some(type_args) = &n.type_args {
punct!("<");
emit!(type_args);
punct!(">");
}
emit!(n.type_args);
}

#[emitter]
Expand Down Expand Up @@ -1073,6 +1069,7 @@ where
keyword!("typeof");
space!();
emit!(n.expr_name);
emit!(n.type_args);
}

#[emitter]
Expand Down
@@ -0,0 +1,2 @@
export type Test = typeof MyClass<string>;
export type Test1 = typeof import("./other.ts").MyClass<string>;
@@ -0,0 +1,2 @@
export type Test = typeof MyClass<string>;
export type Test1 = typeof import("./other.ts").MyClass<string>;
@@ -0,0 +1 @@
export type Test=typeof MyClass<string>;export type Test1=typeof import("./other.ts").MyClass<string>;

0 comments on commit 369fb21

Please sign in to comment.