Skip to content

When the initial element of the tuple is a rest element, it is not possible to correctly infer the type of the initial element. #56885

Open
@13OnTheCode

Description

@13OnTheCode

🔍 Search Terms

initial element of the tuple is a rest element

✅ Viability Checklist

⭐ Suggestion

type T1 = [...string[], number, boolean]

declare const head: T1[0]
         // Actual: string | number | boolean
         // Expected: string | number

📃 Motivating Example

💻 Use Cases

#56883

Metadata

Metadata

Assignees

No one assigned

    Labels

    Awaiting More FeedbackThis means we'd like to hear from more people who would be helped by this featureSuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions