Invalid quick fix for function returning Promise<unknown>
with isolatedDeclarations
#61642
Labels
Milestone
π Search Terms
isolatedDeclarations
, quick fix, promiseπ Version & Regression Information
β― Playground Link
https://www.typescriptlang.org/play/?isolatedDeclarations=true#code/KYDwDg9gTgLgBAMwK4DsDGMCWEVwO4CGmMAqigNYR4oAUAtgM4BccKSdARsFAJRwDeAKDhwowGEii4UwPHAAKUCHUwNgNGnwC8APgEBfHgG5B+waEixEqDNlyFiAZRhRMKAOb1mrdl14DhUXFJaVkFJRU1AB4GFzd3HQ1tPX5DEzMgA
π» Code
π 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.The text was updated successfully, but these errors were encountered: