Closed
Description
Describe the bug
Input code
export class Foo {
private constructor(foo = new Set<string>()) {}
}
Config
{
"jsc": {
"parser": {
"syntax": "typescript",
"tsx": false
},
"target": "es2024",
"experimental": {
"emitIsolatedDts": true
},
}
}
Link to the code that reproduces this issue
SWC Info output
No response
Expected behavior
Transforms fine with no errors as per the TS playground which shows no errors and should emit the following dts:
export declare class Foo {
private constructor();
}
Actual behavior
x TS9011: Parameter must have an explicit type annotation with --isolatedDeclarations.
,-[input.ts:2:1]
1 | export class Foo {
2 | private constructor(foo = new Set<string>()) {}
: ^^^^^^^^^^^^^^^^^^^^^^^
3 | }
`----
Version
1.12.5
Additional context
No response