Skip to content

Use 'Omit' instead of 'Pick<Exclude<...>>' for object rest #30948

Closed

Description

function f<T extends { a, b }>(x: T) {
    let { a, b, ...rest } = x;
}

Today, we type rest as Pick<T, Exclude<keyof T, "a" | "b">>. We should try to type this as Omit<T, "a" | "b"> if Omit is defined.

Activity

  1. added
    Suggestion
    In Discussion
    on Apr 16, 2019
  2. rpgeeganage commented on Apr 25, 2019

    @rpgeeganage
    Contributor

    Hi Nathan Shively-Sanders (@sandersn),
    Can I take this? I like to contribute.
    Thank you

  3. sandersn commented on Apr 25, 2019

    @sandersn
    Member

    Sure, go ahead! Start by looking at let deferredGlobalPickSymbol in checker.ts, and see where and how it's used.

  4. rpgeeganage commented on Apr 26, 2019

    @rpgeeganage
    Contributor

    Nathan Shively-Sanders (@sandersn) ,
    Thank you so much. I’ll start to work on this from today itself.
    Thank you so much.

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

Metadata

Metadata

Labels

Suggestion

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions