-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Closed
Copy link
Labels
BugA bug in TypeScriptA bug in TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issueHelp WantedYou can do thisYou can do this
Milestone
Description
π Search Terms
isolatedDeclarations
, quick fix, promise
π Version & Regression Information
- This is the behavior in every version I tried
β― Playground Link
π» Code
export function waitUnkown(ms: number) {
return new Promise(() => {});
}
export function waitString(ms: number) {
return new Promise<string>(() => {});
}
π Actual behavior
The quick fix for waitUnknown
is "Add return type Promise"
Which annotates the return type as : Promise
-- which is a type error as the argument to the promise type is required.
π Expected behavior
The quick fix for waitUnknown
is "Add return type Promise", which is the correct, currently inferred type.
Additional information about the issue
I was trying to codemod Canva's codebase using ts-fix
and this bug created a bunch of bad code which I would need to fix up by hand.
Copilot
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issueHelp WantedYou can do thisYou can do this