- Notifications
You must be signed in to change notification settings - Fork 13.2k
Closed
Labels
DiscussionIssues which may not have code impactIssues which may not have code impact
Description
TypeScript Version: 3.9.0-dev.20200322
Search Terms:awaited
Code
asyncfunctionrunSequentially<T>(executors: Array<()=>Promise<T>>,): Promise<Array<T>>{constresult: Array<T>=[];for(constexecutorofexecutors){result.push(awaitexecutor());}returnresult;}Expected behavior:
The above code should compile. The types area reasonable and it did compile in previous versions without awaited.
Actual behavior:
Type error on await executor():
Argument of type 'awaited T' is not assignable to parameter of type 'T'. 'T' could be instantiated with an arbitrary type which could be unrelated to 'awaited T'.ts(2345) Playground Link:Playground Link
Related Issues:#37526
Metadata
Metadata
Assignees
Labels
DiscussionIssues which may not have code impactIssues which may not have code impact