mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 12:21:58 +00:00
fix(codegen): print type parameters for MethodDefinition (#3922)
close: #3918
This commit is contained in:
parent
27f0531aac
commit
27665945f1
3 changed files with 9 additions and 1 deletions
|
|
@ -2410,6 +2410,9 @@ impl<'a, const MINIFY: bool> Gen<MINIFY> for MethodDefinition<'a> {
|
||||||
if self.computed {
|
if self.computed {
|
||||||
p.print(b']');
|
p.print(b']');
|
||||||
}
|
}
|
||||||
|
if let Some(type_parameters) = self.value.type_parameters.as_ref() {
|
||||||
|
type_parameters.gen(p, ctx);
|
||||||
|
}
|
||||||
p.print(b'(');
|
p.print(b'(');
|
||||||
self.value.params.gen(p, ctx);
|
self.value.params.gen(p, ctx);
|
||||||
p.print(b')');
|
p.print(b')');
|
||||||
|
|
|
||||||
|
|
@ -5,3 +5,5 @@ export class Foo {
|
||||||
export class Bar {
|
export class Bar {
|
||||||
public constructor(a: number = 0) {}
|
public constructor(a: number = 0) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export class Zoo { foo<F>(f: F): F { return f } }
|
||||||
|
|
@ -10,3 +10,6 @@ export declare class Foo {
|
||||||
export declare class Bar {
|
export declare class Bar {
|
||||||
constructor(a?: number);
|
constructor(a?: number);
|
||||||
}
|
}
|
||||||
|
export declare class Zoo {
|
||||||
|
foo<F>(f: F): F;
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue