TypeScript Version: 3.4.0-dev.201xxxxx
Search Terms:
Code
constw: void="";constx: ()=>void=()=>"";consty: ()=>Promise<void>=async()=>"";functiona(): void{return"";}asyncfunctionb(): Promise<void>{return"";}consty2: ()=>Promise<()=>void>=async()=>()=>"";functiona2(): ()=>void{return()=>"";}functionb2(): Promise<()=>void>{return()=>"";}Expected behavior:
Generally speaking, all of them should be an error, or all of them shouldn't be.
Actual behavior:
We have a special "function returning void" rule that allows () => "" to be assignable to () => void, but this doesn't carry thru to async scenarios, so a async () => "" is not assignable to a () => Promise<void>.
Playground Link
TypeScript Version: 3.4.0-dev.201xxxxx
Search Terms:
Code
Expected behavior:
Generally speaking, all of them should be an error, or all of them shouldn't be.
Actual behavior:
We have a special "function returning void" rule that allows
() => ""to be assignable to() => void, but this doesn't carry thru to async scenarios, so aasync () => ""is not assignable to a() => Promise<void>.Playground Link