Title: Index signature is assignable to weak type whose properties don't match the signature type · Issue #27144 · microsoft/TypeScript · GitHub
Open Graph Title: Index signature is assignable to weak type whose properties don't match the signature type · Issue #27144 · microsoft/TypeScript
X Title: Index signature is assignable to weak type whose properties don't match the signature type · Issue #27144 · microsoft/TypeScript
Description: From https://stackoverflow.com/q/52368008 . Based on #16047 (comment), it appears that Nathan Shively-Sanders (@sandersn) may have thought about the rule, but it still makes no sense to me and no rationale is stated. TypeScript Version: ...
Open Graph Description: From https://stackoverflow.com/q/52368008 . Based on #16047 (comment), it appears that Nathan Shively-Sanders (@sandersn) may have thought about the rule, but it still makes no sense to me and no r...
X Description: From https://stackoverflow.com/q/52368008 . Based on #16047 (comment), it appears that Nathan Shively-Sanders (@sandersn) may have thought about the rule, but it still makes no sense to me and no r...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/27144
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Index signature is assignable to weak type whose properties don't match the signature type","articleBody":"\u003c!-- 🚨 STOP 🚨 𝗦𝗧𝗢𝗣 🚨 𝑺𝑻𝑶𝑷 🚨\r\n\r\nHalf of all issues filed here are duplicates, answered in the FAQ, or not appropriate for the bug tracker. Even if you think you've found a *bug*, please read the FAQ first, especially the Common \"Bugs\" That Aren't Bugs section!\r\n\r\nPlease help us by doing the following steps before logging an issue:\r\n * Search: https://github.com/Microsoft/TypeScript/search?type=Issues\r\n * Read the FAQ: https://github.com/Microsoft/TypeScript/wiki/FAQ\r\n\r\nPlease fill in the *entire* template below.\r\n-->\r\n\r\nFrom https://stackoverflow.com/q/52368008 . Based on https://github.com/Microsoft/TypeScript/pull/16047#issue-122101801, it appears that @sandersn may have thought about the rule, but it still makes no sense to me and no rationale is stated.\r\n\r\n\u003c!-- Please try to reproduce the issue with `typescript@next`. It may have already been fixed. -->\r\n**TypeScript Version:** master (394ee31a56c40033f31a3a8461ec267463033194)\r\n\r\n\u003c!-- Search terms you tried before logging this (so others can find this issue more easily) -->\r\n**Search Terms:** weak type index signature \r\n\r\n**Code**\r\n```ts\r\ninterface Foo {\r\n a?: string;\r\n}\r\ninterface Bar {\r\n [n: string]: number;\r\n}\r\ndeclare let b: Bar;\r\n// No error; expected \"Type 'Bar' has no properties in common with type 'Foo'.\"\r\nlet a: Foo = b;\r\n```\r\n\r\n**Expected behavior:** Error: \"Type 'Bar' has no properties in common with type 'Foo'.\"\r\n\r\n**Actual behavior:** No error.\r\n\r\n**Playground Link:** [link](https://www.typescriptlang.org/play/#src=interface%20Foo%20%7B%0D%0A%20%20%20%20a%3F%3A%20string%3B%0D%0A%7D%0D%0Ainterface%20Bar%20%7B%0D%0A%20%20%20%20%5Bn%3A%20string%5D%3A%20number%3B%0D%0A%7D%0D%0Adeclare%20let%20b%3A%20Bar%3B%0D%0A%2F%2F%20No%20error%3B%20expected%20%22Type%20'Bar'%20has%20no%20properties%20in%20common%20with%20type%20'Foo'.%22%0D%0Alet%20a%3A%20Foo%20%3D%20b%3B%0D%0A)\r\n\r\n**Related Issues:** Possibly #9900\r\n","author":{"url":"https://github.com/mattmccutchen","@type":"Person","name":"mattmccutchen"},"datePublished":"2018-09-17T14:47:00Z","url":"https://github.com/microsoft/TypeScript/issues/27144"}
| 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:1862e79b-7d23-f811-ca89-6f56ac229cc9 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C9D6:33444D:BE00BD:FDFDD2:6B00F74B |
| html-safe-nonce | 0882e7a5a933f8650dcac007f875c907e931c66366166588dc88b2023c0d494e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDOUQ2OjMzNDQ0RDpCRTAwQkQ6RkRGREQyOjZCMDBGNzRCIiwidmlzaXRvcl9pZCI6IjI0NzU0NzAzMjYyOTc4NTE3MjMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 0bb2d7e30a1a962d7ff91f8abe14f5ae127cbba8880fc5b7a281dc49d53f14ca |
| hovercard-subject-tag | issue:360904517 |
| 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/27144/issue_layout |
| twitter:image | https://opengraph.githubassets.com/899f1b3c80db5753c838ed96eac0b6d7245ba492469095687c1ee11ca0f4a855/microsoft/TypeScript/issues/27144 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/899f1b3c80db5753c838ed96eac0b6d7245ba492469095687c1ee11ca0f4a855/microsoft/TypeScript/issues/27144 |
| og:image:alt | From https://stackoverflow.com/q/52368008 . Based on #16047 (comment), it appears that Nathan Shively-Sanders (@sandersn) may have thought about the rule, but it still makes no sense to me and no r... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mattmccutchen |
| 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