mirror of
https://github.com/danbulant/oxc
synced 2026-05-19 12:19:15 +00:00
fix(codegen): print TSFunctionType inside TSTypeAssertion (#3999)
This commit is contained in:
parent
34e8cfc9e5
commit
23038ad8f8
2 changed files with 6 additions and 2 deletions
|
|
@ -3488,6 +3488,11 @@ impl<'a, const MINIFY: bool> GenExpr<MINIFY> for TSTypeAssertion<'a> {
|
|||
fn gen_expr(&self, p: &mut Codegen<{ MINIFY }>, precedence: Precedence, ctx: Context) {
|
||||
p.wrap(precedence > self.precedence(), |p| {
|
||||
p.print_str(b"<");
|
||||
// var r = < <T>(x: T) => T > ((x) => { return null; });
|
||||
// ^ make sure space is printed here.
|
||||
if matches!(self.type_annotation, TSType::TSFunctionType(_)) {
|
||||
p.print_hard_space();
|
||||
}
|
||||
self.type_annotation.gen(p, ctx);
|
||||
p.print_str(b">");
|
||||
self.expression.gen_expr(p, Precedence::Grouping, ctx);
|
||||
|
|
|
|||
|
|
@ -2,8 +2,7 @@ commit: d8086f14
|
|||
|
||||
codegen_typescript Summary:
|
||||
AST Parsed : 5283/5283 (100.00%)
|
||||
Positive Passed: 5279/5283 (99.92%)
|
||||
Normal failed: "compiler/genericTypeAssertions3.ts"
|
||||
Positive Passed: 5280/5283 (99.94%)
|
||||
Normal failed: "compiler/jsxMultilineAttributeStringValues.tsx"
|
||||
Normal failed: "compiler/jsxMultilineAttributeValuesReact.tsx"
|
||||
Normal failed: "conformance/jsx/tsxReactEmitEntities.tsx"
|
||||
|
|
|
|||
Loading…
Reference in a new issue