Skip to content

Latter type parameters are not suggested in constraints of the preceding ones #56474

@Andarist

Description

@Andarist

🔎 Search Terms

type parameters constraints completions

🕗 Version & Regression Information

⏯ Playground Link

https://www.typescriptlang.org/play?ts=5.4.0-dev.20231120#code/GYVwdgxgLglg9mABFApgZygHgGIwE4aIoAeqYAJmogMoD0AVPbQDQ0oQLkB8AFAIYAuRLgJRWAIyHV2nAJSIA3gF8AUCqA

💻 Code

function test<First extends S/**/, Second>(a: First, b: Second) {}

🙁 Actual behavior

Second is not suggested at this marker

🙂 Expected behavior

I'd expect Second to be suggested since depending on the latter type parameters is valid (even if weird at times).

Additional information about the issue

This change was called out in comments of the PR that introduced this (initially it focused only on expression-space parameters) but I wonder if this is something that could be revisited. cc @zardoy

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: LS: Completion ListsThe issue relates to showing completion lists in an editorHelp WantedYou can do this

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions