Closed

Description
TypeScript Version: 3.7.5 and 3.8.0-dev.20200128
Search Terms: "default value" parameter "type definition"
Code
tsc --allowJs --declaration --outDir out x.js
x.js:
export class Z {
f(x = 1, y) {
return [x, y];
}
}
Expected behavior:
x.d.ts should be:
export class Z {
f(x: number | undefined, y: any): any[];
}
Actual behavior:
x.d.ts contains invalid typescript:
export class Z {
f(x?: number, y: any): any[];
}
Playground Link: Playground Link
Related Issues: None
Notes: Both top-level functions (in either .js or .ts) and class instance methods in .ts files have correct type defs generated in both 3.7.5 and 3.8.0-dev.20200128