Skip to content

False positive "await has no effect on the type" diagnostic with mixed generic unionΒ #50832

@Andarist

Description

@Andarist

Bug Report

πŸ”Ž Search Terms

await has no effect on type, 80007

πŸ•— Version & Regression Information

  • This is the behavior in every version I tried

⏯ Playground Link

Playground link with relevant code

πŸ’» Code

async function fn2<T extends Promise<void> | void>(a: T) {
  await a; // reports 80007
}

πŸ™ Actual behavior

It reports:

'await' has no effect on the type of this expression.(80007)

πŸ™‚ Expected behavior

No problem should be reported here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScript

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions