Skip to content

Completions for string literal type parameter don't work if it's constraint includes an empty string #47227

Description

Bug Report

🔎 Search Terms

String literal completions, empty string constraint, intellisense

🕗 Version & Regression Information

Tested with v4.5.4

⏯ Playground Link

Playground

💻 Code

declareconstfoo1: (p: ""|"bar"|"baz")=>voidfoo1("")// ^|// expected completions: "", "bar", "baz"// actual completions: "", "bar", "baz"declareconstfoo2: <Pextends""|"bar"|"baz">(p: P)=>voidfoo2("")// ^|// expected completions: "", "bar", "baz"// actual completions: none

🙁 Actual behavior

foo2 has no completions

🙂 Expected behavior

foo2 should have same completions like foo1 which are "", "bar", "baz"

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions