Skip to content

Adjust Omit's 2nd param to allow autocompletion of 1st param's keys #43768

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
wants to merge 1 commit into from

Conversation

EvanLovely
Copy link

Consider this code example when using Omit:

type Person = { 
  firstName: string; 
  lastName: string;
}
type X = Omit<Person, 'lastName'>;

Before, no autocompletion would happen when typing out 'lastName' and after this PR it does autocomplete the keys from Person.

Have a nice day! 👋

@typescript-bot typescript-bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Apr 21, 2021
@typescript-bot
Copy link
Collaborator

This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise.

@tjjfvi
Copy link
Contributor

tjjfvi commented Apr 21, 2021

This is a breaking change; Omit<{ foo: 1 }, "bar"> being valid and a no-op is likely highly relied on

@AviVahl
Copy link

AviVahl commented Apr 22, 2021

See discussion at #30825

@EvanLovely
Copy link
Author

Makes sense; thanks for insight 👍

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
For Uncommitted Bug PR for untriaged, rejected, closed or missing bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants