🐛 Bug Report
- TypeStat version: 0.7.3
- TypeScript version: 4.9.5
- Node version: 20.11
Actual Behavior
declare function navigateByUrl(url: string): Promise<boolean>;
export class exampleDirective {
async navigateTo(id: number): Promise<boolean> | boolean | boolean | boolean | boolean | boolean {
return await navigateByUrl(`/page/${id}`);
}
}
Expected Behavior
There is no need to change this the return type. This is async function and Promise<boolean> should cover that. But also, it should not add boolean infinite amount to return types union.
declare function navigateByUrl(url: string): Promise<boolean>;
export class exampleDirective {
async navigateTo(id: number): Promise<boolean> {
return await navigateByUrl(`/page/${id}`);
}
}
Reproduction
Original code
declare function navigateByUrl(url: string): Promise<boolean>;
export class exampleDirective {
async navigateTo(id: number): Promise<boolean> {
return await navigateByUrl(`/page/${id}`);
}
}
I cloned this repo and added this test case to test/cases/fixes/incompleteTypes/returnTypes/original.ts file, and I can see same behavior there.
function navigateByUrl(url: string): Promise<boolean>;
async function navigateTo(id: number): Promise<boolean> {
return await navigateByUrl(`/page/${id}`);
}
After using command yarn run test:mutation --accept, I see this in excepted.ts and actual.ts:
function navigateByUrl(url: string): Promise<boolean>;
async function navigateTo(id: number): Promise<boolean> | boolean | boolean | boolean | boolean | boolean | boolean | boolean | boolean | boolean | boolean | boolean | boolean | boolean | boolean | boolean | boolean | boolean | boolean | boolean | boolean {
return await navigateByUrl(`/page/${id}`);
}
🐛 Bug Report
Actual Behavior
Expected Behavior
There is no need to change this the return type. This is async function and
Promise<boolean>should cover that. But also, it should not addbooleaninfinite amount to return types union.Reproduction
Original code
I cloned this repo and added this test case to
test/cases/fixes/incompleteTypes/returnTypes/original.tsfile, and I can see same behavior there.After using command
yarn run test:mutation --accept, I see this inexcepted.tsandactual.ts: