fix(codegen): missing TypeParamters in TSCallSignature (#4021)

close: #4015
This commit is contained in:
Dunqing 2024-07-02 11:10:15 +00:00
parent 432d6d93c9
commit 6254a4106f
2 changed files with 4 additions and 0 deletions

View file

@ -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);

View file

@ -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) {