Skip to content

Maybe false positive from TS2801 (Promise<...> appears to always be defined)Β #45608

Closed
@plantain-00

Description

@plantain-00

Bug Report

πŸ”Ž Search Terms

TS2801

πŸ•— Version & Regression Information

  • This changed between versions 4.4.2 and 4.3.5

⏯ Playground Link

Playground link with relevant code

πŸ’» Code

const a: { [key: string]: Promise<string> } = {}
if (a['a']) {
  
}

πŸ™ Actual behavior

This condition will always return true since this 'Promise' is always defined.

πŸ™‚ Expected behavior

No error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions