Skip to content

Completions fail to be provided for type alias arguments before all required type arguments are providedΒ #59222

Open

Description

πŸ”Ž Search Terms

string completions type alias

πŸ•— Version & Regression Information

  • This is the behavior in every version I tried

⏯ Playground Link

https://www.typescriptlang.org/play/?ts=5.6.0-dev.20240710#code/C4TwDgpgBA4hwGED2A7AxgJ3hAQiA0hCADwAqANFKYSFBAB7AQoAmAzlANZFIBmVlUgDUAhgBsArtAZNWHUgG1qRALoA+KAF4qUAGQAoKFABKENEgwsyNQaMkQ1Abn37QkKADERASzEdtcIiomNh4NMQA3lBuEABcUABEvEhICVAAvlAAPlBRMfEJAEYiGGnplAkJTq7g0ADqFpz+sPDI6FhMYUSR0bUFyakZ2bm9kAXFpRkVCRUDVc76DGAWwLnpzkA

πŸ’» Code

type GetConcreteByKey<T, TKey extends keyof T, TValue extends T[TKey]> = T &
  Record<TKey, TValue>;

type Fails = GetConcreteByKey<{ type: "foo" } | { type: "bar" }, "">;
type Works = GetConcreteByKey<{ type: "foo" } | { type: "bar" }, "", "foo">;

export {};

πŸ™ Actual behavior

Completions are not provided for the second type argument in Fails

πŸ™‚ Expected behavior

I'd expect this to work the same way as it works in Works

Additional information about the issue

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Domain: Completion ListsThe issue relates to showing completion lists in an editorHelp WantedYou can do thisPossible ImprovementThe current behavior isn't wrong, but it's possible to see that it might be better in some cases

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions