Skip to content

transformer: design:paramtypes is calculated by the first overload signature instead of the implementation signature #20369

@sapphi-red

Description

@sapphi-red
@dec
class MyService {
    // Overload 1
    constructor(a: string);
    // Overload 2
    constructor(a: string, b: string);
    // Implementation
    constructor(a?: string, b?: string) {}
}

For this input, Oxc outputs

let MyService = class MyService {
	// Implementation
	constructor(a, b) {}
};
MyService = _decorate([
    dec,
    _decorateMetadata("design:paramtypes", [String])
], MyService);

(playground)
but it should be

let MyService = class MyService {
    // Implementation
    constructor(a, b) {}
};
MyService = _decorate([
    dec,
    _decorateMetadata("design:paramtypes", [String, String]) // <-- this line is the diff
], MyService);

(TS playground).

Metadata

Metadata

Assignees

Labels

A-transformerArea - Transformer / TranspilerP-highPriority - High

Type

Priority

None yet

Effort

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions