-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Closed as not planned
Labels
Working as IntendedThe behavior described is the intended behavior; this is not a bugThe behavior described is the intended behavior; this is not a bug
Description
In the definition of Omit, we have:
type Omit<T, K extends keyof any> = Pick<T, Exclude<keyof T, K>>;
However, I assume this definition is incorrect because we are trying to exclude some keys (K) from the type (T), but K is defined as K extends keyof any. I believe it should be K extends keyof T instead, so that we only allow keys from T to be excluded from T.
🙁 Actual behavior
type Omit<T, K extends keyof any> = Pick<T, Exclude<keyof T, K>>;
🙂 Expected behavior
type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
Metadata
Metadata
Assignees
Labels
Working as IntendedThe behavior described is the intended behavior; this is not a bugThe behavior described is the intended behavior; this is not a bug