diff --git a/crates/oxc_codegen/src/gen.rs b/crates/oxc_codegen/src/gen.rs index 0d474511f1659c..06a7162b962b12 100644 --- a/crates/oxc_codegen/src/gen.rs +++ b/crates/oxc_codegen/src/gen.rs @@ -2033,6 +2033,9 @@ impl<'a> Gen for TaggedTemplateExpression<'a> { fn gen(&self, p: &mut Codegen, ctx: Context) { p.add_source_mapping(self.span.start); self.tag.gen_expr(p, Precedence::Postfix, Context::empty()); + if let Some(type_parameters) = &self.type_parameters { + type_parameters.gen(p, ctx); + } self.quasi.gen(p, ctx); } } diff --git a/crates/oxc_codegen/tests/integration/snapshots/ts.snap b/crates/oxc_codegen/tests/integration/snapshots/ts.snap index 5584266fafe65f..a5ecd7f2cb2e6d 100644 --- a/crates/oxc_codegen/tests/integration/snapshots/ts.snap +++ b/crates/oxc_codegen/tests/integration/snapshots/ts.snap @@ -109,3 +109,6 @@ d = ((x) satisfies y); export @x declare abstract class C {} export @x declare abstract class C {} + +div`` +div``; diff --git a/crates/oxc_codegen/tests/integration/ts.rs b/crates/oxc_codegen/tests/integration/ts.rs index 7944aae11295ae..b5401f08f21319 100644 --- a/crates/oxc_codegen/tests/integration/ts.rs +++ b/crates/oxc_codegen/tests/integration/ts.rs @@ -51,6 +51,7 @@ fn ts() { "c = foo;", "d = x satisfies y;", "export @x declare abstract class C {}", + "div``" ]; let snapshot = cases.into_iter().fold(String::new(), |mut w, case| {