Closed
Description
TypeScript Version: 3.6.3
Omit extended generic type, type has no properties in common with type Pick Exclude
interface Bar {
type: string;
id?: string;
}
class Foo\<T extends Bar = Bar> {
getParam (param: keyof Omit<T, 'type'>) {}
test () {
this.getParam('id');
}
}
Expected behavior:
exclude the "type" property, and get in the available properties for the parameter "param" id and the rest that will be present in the interface because Bar is default param for T
Actual behavior:
Error "Type 'type' has no properties in common with type Pick <T, Exclude , 'type'>"
Playground Link:
https://stackblitz.com/edit/typescript-8zyjig
Related Issues: #24791