diff --git a/crates/oxc_codegen/src/gen.rs b/crates/oxc_codegen/src/gen.rs index 26d2a278de32..9672ad0769a8 100644 --- a/crates/oxc_codegen/src/gen.rs +++ b/crates/oxc_codegen/src/gen.rs @@ -3073,6 +3073,9 @@ impl<'a, const MINIFY: bool> Gen for TSSignature<'a> { } } Self::TSCallSignatureDeclaration(signature) => { + if let Some(type_parameters) = signature.type_parameters.as_ref() { + type_parameters.gen(p, ctx); + } p.print_str(b"("); if let Some(this_param) = &signature.this_param { this_param.gen(p, ctx); diff --git a/crates/oxc_codegen/tests/mod.rs b/crates/oxc_codegen/tests/mod.rs index ba8742becf6e..c6df2b62c59c 100644 --- a/crates/oxc_codegen/tests/mod.rs +++ b/crates/oxc_codegen/tests/mod.rs @@ -199,6 +199,7 @@ fn typescript() { "class A {\n\treadonly type = 'frame';\n}\n", false, ); + test_ts("let foo: { (t: T): void }", "let foo: {(t: T): void};\n", false); } fn test_comment_helper(source_text: &str, expected: &str) {