Title: "Did you mean" spelling suggestions can offer the same thing being complained about · Issue #25564 · microsoft/TypeScript · GitHub
Open Graph Title: "Did you mean" spelling suggestions can offer the same thing being complained about · Issue #25564 · microsoft/TypeScript
X Title: "Did you mean" spelling suggestions can offer the same thing being complained about · Issue #25564 · microsoft/TypeScript
Description: TypeScript Version: 2.92 Search Terms: did you mean spelling suggestion same Code type NonVoid = Object | object; type Something
Open Graph Description: TypeScript Version: 2.92 Search Terms: did you mean spelling suggestion same Code type NonVoid = Object | object; type Something
X Description: TypeScript Version: 2.92 Search Terms: did you mean spelling suggestion same Code type NonVoid = Object | object; type Something<T> = { test: string } & (T extends NonVoid ? { requiredWhe...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/25564
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"\"Did you mean\" spelling suggestions can offer the same thing being complained about","articleBody":"**TypeScript Version:** 2.92\r\n\r\n**Search Terms:** did you mean spelling suggestion same\r\n\r\n**Code**\r\n\r\n```ts\r\ntype NonVoid = Object | object;\r\n\r\ntype Something\u003cT\u003e = { test: string } \u0026 (T extends NonVoid ? {\r\n requiredWhenNonVoid: T\r\n} : {\r\n requiredWhenNonVoid?: undefined\r\n });\r\n\r\nfunction testFunc2\u003cA extends NonVoid\u003e(a: A): Something\u003cA\u003e {\r\n return {\r\n test: 'test',\r\n requiredWhenNonVoid: a\r\n// ~~~~~~~~~~~~~~~~~~~\r\n };\r\n}\r\n```\r\n\r\n**Expected behavior:** Probably no error, or at least not this error suggestion\r\n\r\n**Actual behavior:** \r\n\r\n```\r\nclipboard.ts:12 requiredWhenNonVoid: a\r\n ~~~~~~~~~~~~~~~~~~~~~~\r\n TS2322: Type '{ test: string; requiredWhenNonVoid: A; }' is not assignable to type 'Something\u003cA\u003e'.\r\n Object literal may only specify known properties, but 'requiredWhenNonVoid' does not exist in type 'Something\u003cA\u003e'. Did you mean to write 'requiredWhenNonVoid'?\r\n```\r\n\r\nThere's no spelling error here -- the `requiredWhenNonVoid` being cited is the same `requiredWhenNonVoid` being suggested 🤡 \r\n\r\n**Playground Link:** [Link](http://www.typescriptlang.org/play/#src=interface%20Foo%20%7B%20hello%3A%20string%20%7D%3B%0A%0Afunction%20bar1(...foos%3A%20Foo%5B%5D)%20%7B%0A%20%20%20%20bar2(...foos)%3B%0A%7D%0A%0Afunction%20bar2(foo1%3A%20Foo)%3B%0Afunction%20bar2(foo1%3A%20Foo%2C%20foo2%3A%20Foo)%3B%0Afunction%20bar2(...foos%3A%20Foo%5B%5D)%20%7B%0A%20%20%20%20return%3B%0A%7D%0A)\r\n\r\n**Related Issues:** Nope","author":{"url":"https://github.com/RyanCavanaugh","@type":"Person","name":"RyanCavanaugh"},"datePublished":"2018-07-10T21:41:36.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":9},"url":"https://github.com/25564/TypeScript/issues/25564"}
| 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:9b314171-4122-3762-e8c8-abf306e1df3a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CEAE:19F67D:169900C:204433B:6A635437 |
| html-safe-nonce | aa691eb47f3577f3bca970cc93e2a394094266305c2246ef1f64e432548cf724 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRUFFOjE5RjY3RDoxNjk5MDBDOjIwNDQzM0I6NkE2MzU0MzciLCJ2aXNpdG9yX2lkIjoiNjcyNjEwMjg3ODIwOTEzNTY3MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | d98ab7e200685e69fa95c894b7c356c599e509bef842205dea181e292a882aa9 |
| hovercard-subject-tag | issue:340017281 |
| 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/25564/issue_layout |
| twitter:image | https://opengraph.githubassets.com/9074b9ca9357e963dd5344c96d233372b344eb8e278180ad05756c2a168f30ad/microsoft/TypeScript/issues/25564 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9074b9ca9357e963dd5344c96d233372b344eb8e278180ad05756c2a168f30ad/microsoft/TypeScript/issues/25564 |
| og:image:alt | TypeScript Version: 2.92 Search Terms: did you mean spelling suggestion same Code type NonVoid = Object | object; type Something |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | RyanCavanaugh |
| hostname | github.com |
| expected-hostname | github.com |
| None | 59e55daad7174ca59d63c6974d58276ccb5477442e550bebb3c035e1bef11c94 |
| 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 | 990295d92a4cc7b63fbbd83a046217cd7d77d49c |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width