Title: TS losing optional properties when used with index signature and generics · Issue #9900 · microsoft/TypeScript · GitHub
Open Graph Title: TS losing optional properties when used with index signature and generics · Issue #9900 · microsoft/TypeScript
X Title: TS losing optional properties when used with index signature and generics · Issue #9900 · microsoft/TypeScript
Description: TypeScript Version: 2.0.0-beta Code Base code: // A *self-contained* demonstration of the problem follows... interface Test { a?: number; b?: string; } interface TestWithStrictProp { a?: number; b?: string; c: string; } interface TestInd...
Open Graph Description: TypeScript Version: 2.0.0-beta Code Base code: // A *self-contained* demonstration of the problem follows... interface Test { a?: number; b?: string; } interface TestWithStrictProp { a?: number; b?...
X Description: TypeScript Version: 2.0.0-beta Code Base code: // A *self-contained* demonstration of the problem follows... interface Test { a?: number; b?: string; } interface TestWithStrictProp { a?: number; b?...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/9900
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"TS losing optional properties when used with index signature and generics","articleBody":"**TypeScript Version:** 2.0.0-beta\n\n**Code**\n\nBase code:\n\n``` ts\n// A *self-contained* demonstration of the problem follows...\n interface Test {\n a?: number;\n b?: string;\n }\n interface TestWithStrictProp {\n a?: number;\n b?: string;\n c: string;\n }\n\n interface TestIndex {\n [key: string]: Test;\n }\n interface TestIndexWithStrict {\n [key: string]: TestWithStrictProp;\n }\n declare function testFunc\u003cT extends TestIndex>(t: T): void;\n declare function testFuncStrict\u003cT extends TestIndexWithStrict>(t: T): void;\n```\n\nConsumer code\n\n``` ts\ntestFunc({\n test: {\n // Compiler doesn't see properties here\n }\n});\n\ntestFuncStrict({\n test: {\n // Compiler see a?, b? and c\n }\n});\n```\n\n**Expected behavior:**\nCompletion in testFunc({ test: { ... } });\n","author":{"url":"https://github.com/asvetliakov","@type":"Person","name":"asvetliakov"},"datePublished":"2016-07-22T16:29:35Z","url":"https://github.com/microsoft/TypeScript/issues/9900"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| 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:8ba92c9e-40cc-d287-b90f-2c703d8d2543 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A93C:23CF06:11E449E:16F2A8C:6B010C36 |
| html-safe-nonce | 105624f724b2e9c2440a58f7159ac4e1c08c91e0549a08abc84067e0dc6bafad |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBOTNDOjIzQ0YwNjoxMUU0NDlFOjE2RjJBOEM6NkIwMTBDMzYiLCJ2aXNpdG9yX2lkIjoiNjEyOTYyMDU3MzIyNTAyODY2MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | f599219351d493c29744767fbc0fae36b3b50986f25f9aeee10fbfb7ff8edae9 |
| hovercard-subject-tag | issue:167083210 |
| 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/9900/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ec302af08dbbda113d8f0020c5b183116f88b33301223855df9645b2bceacf42/microsoft/TypeScript/issues/9900 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ec302af08dbbda113d8f0020c5b183116f88b33301223855df9645b2bceacf42/microsoft/TypeScript/issues/9900 |
| og:image:alt | TypeScript Version: 2.0.0-beta Code Base code: // A *self-contained* demonstration of the problem follows... interface Test { a?: number; b?: string; } interface TestWithStrictProp { a?: number; b?... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | asvetliakov |
| hostname | github.com |
| expected-hostname | github.com |
| None | cb7fa109eca7d4156c889f474306b0e91336055e9adf8fd4684b61e49094d124 |
| 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 | 2b59d31a4e44f08b7af67a4b67f8fd0af3befe2a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width