Skip to content

Commit

Permalink
fix(codegen): missing TypeParamters in TSCallSignature (#4021)
Browse files Browse the repository at this point in the history
close: #4015
  • Loading branch information
Dunqing committed Jul 2, 2024
1 parent 432d6d9 commit 6254a41
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions crates/oxc_codegen/src/gen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3073,6 +3073,9 @@ impl<'a, const MINIFY: bool> Gen<MINIFY> 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);
Expand Down
1 change: 1 addition & 0 deletions crates/oxc_codegen/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ fn typescript() {
"class A {\n\treadonly type = 'frame';\n}\n",
false,
);
test_ts("let foo: { <T>(t: T): void }", "let foo: {<T>(t: T): void};\n", false);
}

fn test_comment_helper(source_text: &str, expected: &str) {
Expand Down

0 comments on commit 6254a41

Please sign in to comment.