Type '{ key: number; } & Pick<T, Exclude<keyof T, "key">>' is not assignable to type 'T'.
'{ key: number; } & Pick<T, Exclude<keyof T, "key">>' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{ key: number; }'.
TypeScript Version: 3.7.0-dev.20190924
Search Terms: destructure spread generic
Code
Expected behavior:
No type errors
Actual behavior:
Playground Link: https://www.typescriptlang.org/play/index.html?ts=Nightly#code/GYVwdgxgLglg9mABFApgZygHgCqJQD1TABM1EBvAaxQE8AuRMEAWwCMUAnAXwD4AKKrQA0iAHTiO6KFwbYAlLIoBYAFCJEkqCA5JB9RAEYADCPGjJGLqq5A
Related Issues: #26412 #10727 #28234 #28312 #18552