TypeScript Version: 2.5.2
Code
export interface ConfirmationComponentProps { title?: string, } function propTypes<OProps extends {}>() : {[K in keyof (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:
function propTypes<OProps extends {}>() : {[K in keyof {x: number} & ConfirmationComponentProps]?: any } { return { title: null, }; };
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4