TypeScript Version: 2.5.2
Code
exportinterfaceConfirmationComponentProps{title?: string,}functionpropTypes<OPropsextends{}>() : {[Kinkeyof(OProps&ConfirmationComponentProps)]?: any}{return{title: null,};};Expected behavior:
Compile with no errors.
Actual behavior:
Fails with: { title: null }is not assignable to {[K in keyof (OProps & ConfirmationComponentProps)]?: any }`
The problem disappears if I remove the intersection type & and just use ConfirmationComponentProps; or if I replace OProps with a concrete type like:
functionpropTypes<OPropsextends{}>() : {[Kinkeyof{x: number}&ConfirmationComponentProps]?: any}{return{title: null,};};
TypeScript Version: 2.5.2
Code
Expected behavior:
Compile with no errors.
Actual behavior:
Fails with:
{ title: null }is not assignable to {[K in keyof (OProps & ConfirmationComponentProps)]?: any }`The problem disappears if I remove the intersection type
&and just useConfirmationComponentProps; or if I replace OProps with a concrete type like: