Title: No excess properties error in nested intersection type · Issue #13813 · microsoft/TypeScript · GitHub
Open Graph Title: No excess properties error in nested intersection type · Issue #13813 · microsoft/TypeScript
X Title: No excess properties error in nested intersection type · Issue #13813 · microsoft/TypeScript
Description: TypeScript Version: 2.1.5 Code interface A { x: string } interface B { a: A; } interface C { c: number; } type D = B & C; let a: B = {a: {x: 'hello'}}; // ok let b: B = {a: {x: 2}}; // error - types of property x are incompatible let c: ...
Open Graph Description: TypeScript Version: 2.1.5 Code interface A { x: string } interface B { a: A; } interface C { c: number; } type D = B & C; let a: B = {a: {x: 'hello'}}; // ok let b: B = {a: {x: 2}}; // error - type...
X Description: TypeScript Version: 2.1.5 Code interface A { x: string } interface B { a: A; } interface C { c: number; } type D = B & C; let a: B = {a: {x: 'hello'}}; // ok let b: B = {a: {x: 2}}; // ...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/13813
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"No excess properties error in nested intersection type","articleBody":"\u003c!-- BUGS: Please use this template. -->\r\n\u003c!-- QUESTIONS: This is not a general support forum! Ask Qs at http://stackoverflow.com/questions/tagged/typescript -->\r\n\u003c!-- SUGGESTIONS: See https://github.com/Microsoft/TypeScript-wiki/blob/master/Writing-Good-Design-Proposals.md -->\r\n\r\n**TypeScript Version:** 2.1.5\r\n\r\n**Code**\r\n\r\n```ts\r\ninterface A {\r\n x: string\r\n}\r\n\r\ninterface B {\r\n a: A;\r\n}\r\n\r\ninterface C {\r\n c: number;\r\n}\r\n\r\ntype D = B & C;\r\n\r\nlet a: B = {a: {x: 'hello'}}; // ok\r\nlet b: B = {a: {x: 2}}; // error - types of property x are incompatible\r\nlet c: B = {a: {x: 'hello', y: 2}}; // error - y does not exist in type A\r\n\r\nlet d: D = {a: {x: 'hello'}, c: 5}; // ok\r\nlet e: D = {a: {x: 2}, c: 5}; // error - types of property x are incompatible\r\nlet f: D = {a: {x: 'hello', y: 2}, c: 5}; // should be an error?: y does not exist in type A\r\n\r\n\r\n```\r\n\r\n**Expected behavior:** \r\nExcess property checking should cause a compiler error for the last example.\r\n\r\n**Actual behavior:**\r\nLast example compiles without error.\r\n","author":{"url":"https://github.com/sktw","@type":"Person","name":"sktw"},"datePublished":"2017-02-01T15:31:12Z","url":"https://github.com/microsoft/TypeScript/issues/13813"}
| 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:be1e0b07-92fb-29d7-0179-1fa4b7636bf8 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D21A:25A204:C47C0B:1040725:6B00F273 |
| html-safe-nonce | 65765447fdd13f0662302eba68aeb3e3bdd9bbc1f873e387ddd6e42e8c09600c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMjFBOjI1QTIwNDpDNDdDMEI6MTA0MDcyNTo2QjAwRjI3MyIsInZpc2l0b3JfaWQiOiIzNjMwMjM2OTk2MDk5Njk5MzE1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 5510545a51ee9acc96e6f98b37c3589c1583245ea5869302c8ca988c32c512f0 |
| hovercard-subject-tag | issue:204615696 |
| 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/13813/issue_layout |
| twitter:image | https://opengraph.githubassets.com/249c5c2911e8736704e790d5597b71bfd9e83c5f49b80189227ebe6df089aa4a/microsoft/TypeScript/issues/13813 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/249c5c2911e8736704e790d5597b71bfd9e83c5f49b80189227ebe6df089aa4a/microsoft/TypeScript/issues/13813 |
| og:image:alt | TypeScript Version: 2.1.5 Code interface A { x: string } interface B { a: A; } interface C { c: number; } type D = B & C; let a: B = {a: {x: 'hello'}}; // ok let b: B = {a: {x: 2}}; // error - type... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | sktw |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4ef498cbabcbe3c50befc7a5b743e7072ee770b4daf0e15e54801180d1fa91fc |
| 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 | 9983dd5da06943f833c971dd5b6bc988e2858be5 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width