-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed
Labels
Working as IntendedThe behavior described is the intended behavior; this is not a bugThe behavior described is the intended behavior; this is not a bug
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
Metadata
Metadata
Assignees
Labels
Working as IntendedThe behavior described is the intended behavior; this is not a bugThe behavior described is the intended behavior; this is not a bug