Skip to content

Commit b811f08

Browse files
authored
fix: emit TypeQuery type arguments (#427)
1 parent 543a610 commit b811f08

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/generation/generate.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5852,6 +5852,9 @@ fn gen_type_query<'a>(node: &'a TsTypeQuery, context: &mut Context<'a>) -> Print
58525852
items.push_str("typeof");
58535853
items.push_signal(Signal::SpaceIfNotTrailing);
58545854
items.extend(gen_node(node.expr_name.into(), context));
5855+
if let Some(type_args) = node.type_args {
5856+
items.extend(gen_node(type_args.into(), context));
5857+
}
58555858
items
58565859
}
58575860

tests/specs/issues/issue0426.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
== should emit type arguments in typeof expressions ==
2+
function getCtor(): typeof MyClass<Foo>;
3+
4+
[expect]
5+
function getCtor(): typeof MyClass<Foo>;

0 commit comments

Comments
 (0)