Title: Mapped type optional -> required property issue · Issue #13224 · microsoft/TypeScript · GitHub
Open Graph Title: Mapped type optional -> required property issue · Issue #13224 · microsoft/TypeScript
X Title: Mapped type optional -> required property issue · Issue #13224 · microsoft/TypeScript
Description: TypeScript Version: 2.1.4 Code https://github.com/JakeGinnivan/TypeScriptMappedTypeIssue Expected behavior: The mapped type export type PropDescriptions
Open Graph Description: TypeScript Version: 2.1.4 Code https://github.com/JakeGinnivan/TypeScriptMappedTypeIssue Expected behavior: The mapped type export type PropDescriptions
X 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 mar...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/13224
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Mapped type optional -\u003e required property issue","articleBody":"**TypeScript Version:** 2.1.4\r\n\r\n**Code**\r\nhttps://github.com/JakeGinnivan/TypeScriptMappedTypeIssue\r\n\r\n**Expected behavior:**\r\nThe mapped type\r\n\r\n``` ts\r\nexport type PropDescriptions\u003cT\u003e = {\r\n [P in keyof T]: string\r\n}\r\n```\r\n\r\nIs marking all the properties as required, I would expect this to fail:\r\n\r\n```\r\ninterface ThingProps {\r\n prop1: string\r\n prop2?: string\r\n}\r\n\r\nconst expected: PropDescriptions\u003cThingProps\u003e = {\r\n prop1: 'Ok'\r\n}\r\n```\r\n\r\nwith `Property 'prop2' is missing in type {...}`\r\n\r\n**Actual behavior:**\r\nNo compilation error","author":{"url":"https://github.com/JakeGinnivan","@type":"Person","name":"JakeGinnivan"},"datePublished":"2016-12-30T07:41:14.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/13224/TypeScript/issues/13224"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:28b99c26-f2f1-fffc-43a7-8e1700dfde52 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A3D2:15A7CC:150E65F:1CB6D32:6A65151B |
| html-safe-nonce | 910245d3133feb7210fc95043e31b6ad4ba20aca5aa2177a8740299c163f92b5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBM0QyOjE1QTdDQzoxNTBFNjVGOjFDQjZEMzI6NkE2NTE1MUIiLCJ2aXNpdG9yX2lkIjoiNDA1ODYzNzUxMTQ4MTgwNzYzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 9b22ed12c1101ba1e9df2c140727ca922a672c3b8a4a9eeffc00a4b0a0aa0dc2 |
| hovercard-subject-tag | issue:198115010 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/TypeScript/13224/issue_layout |
| twitter:image | https://opengraph.githubassets.com/0c8134e4f6bab61ce0ae8e55ec3d99ae14d4cb436ac231daec2e1f9528839fff/microsoft/TypeScript/issues/13224 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/0c8134e4f6bab61ce0ae8e55ec3d99ae14d4cb436ac231daec2e1f9528839fff/microsoft/TypeScript/issues/13224 |
| og:image:alt | TypeScript Version: 2.1.4 Code https://github.com/JakeGinnivan/TypeScriptMappedTypeIssue Expected behavior: The mapped type export type PropDescriptions |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | JakeGinnivan |
| hostname | github.com |
| expected-hostname | github.com |
| None | 52c76df668885aaff23b50bdca1fa1ea44ac9c1553e888ebc70ff1e4daa4625b |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 20929025 |
| octolytics-dimension-repository_nwo | microsoft/TypeScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 20929025 |
| octolytics-dimension-repository_network_root_nwo | microsoft/TypeScript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 309153364422b3c499922d1a2a6404910a58ed8e |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width