Closed
Description
TypeScript Version: 2.1.4
Code
https://github.com/JakeGinnivan/TypeScriptMappedTypeIssue
Expected behavior:
The mapped type
export type PropDescriptions<T> = {
[P in keyof T]: string
}
Is marking all the properties as required, I would expect this to fail:
interface ThingProps {
prop1: string
prop2?: string
}
const expected: PropDescriptions<ThingProps> = {
prop1: 'Ok'
}
with Property 'prop2' is missing in type {...}
Actual behavior:
No compilation error