Title: Quickinfo incorrectly computes zero-candidate type parameter with contextual inference candidate · Issue #44879 · microsoft/TypeScript · GitHub
Open Graph Title: Quickinfo incorrectly computes zero-candidate type parameter with contextual inference candidate · Issue #44879 · microsoft/TypeScript
X Title: Quickinfo incorrectly computes zero-candidate type parameter with contextual inference candidate · Issue #44879 · microsoft/TypeScript
Description: Bug Report 🔎 Search Terms intellisense, contextual inference, call site inference Related: #44821 🕗 Version & Regression Information Tested with v4.3.4 ⏯ Playground Link Playground 💻 Code m({ foo: $("foo") }); // unexpected error declare...
Open Graph Description: Bug Report 🔎 Search Terms intellisense, contextual inference, call site inference Related: #44821 🕗 Version & Regression Information Tested with v4.3.4 ⏯ Playground Link Playground 💻 Code m({ foo: ...
X Description: Bug Report 🔎 Search Terms intellisense, contextual inference, call site inference Related: #44821 🕗 Version & Regression Information Tested with v4.3.4 ⏯ Playground Link Playground 💻 Code m({ f...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/44879
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Quickinfo incorrectly computes zero-candidate type parameter with contextual inference candidate","articleBody":"# Bug Report\r\n### 🔎 Search Terms\r\n\r\nintellisense, contextual inference, call site inference\r\nRelated: #44821\r\n\r\n### 🕗 Version & Regression Information\r\n\r\nTested with v4.3.4\r\n\r\n### ⏯ Playground Link\r\n\r\n[Playground](https://www.typescriptlang.org/play?jsx=0#code/LYCg3gBAZg9jBcEAkIBEsaoJQQL5YG4IB6YiAVwDsBTADwAdqBjAF2oBMJqAnbmbgFAD2zADYBDbtQhMYlAM4sIweAIgQAPAGUutNpXbyIi7gEtKAcwB8IeYkgBtAPoRzELQF17yRADkYAJKUUDzaVnh4OAC84QBuMKbsQiJMElIycoo+mloANBAAKrr6hu42doXRVmoQkEiIOrhCLACejBD+QSHcGgXhURAOBR5DxdQGRuKULRAA-BAADBCINLE8HgQCQA)\r\n\r\n### 💻 Code\r\n\r\n```ts\r\nm({ foo: $(\"foo\") }); // unexpected error\r\n\r\ndeclare const m:\r\n \u003cS extends string>(s: { [_ in S]: { $: NoInfer\u003cS> } }) => void\r\n\r\ndeclare const $: \u003cS, T extends S>(s: T) =>\r\n { $: S }\r\n\r\ntype NoInfer\u003cT> = [T][T extends any ? 0 : never];\r\n```\r\n\r\n### 🙁 Actual behavior\r\n\r\nCode does not compile\r\n\r\n### 🙂 Expected behavior\r\n\r\nCode should compile. Especially when the intellisense gets the type parameters right and also provides completions.\r\n\r\nExpected type parameters and return type -\r\n\r\n\r\n\r\nExpected completion -\r\n\r\n\r\n\r\nBut doesn't compile and gives error - \r\n\r\n\r\n\r\n","author":{"url":"https://github.com/devanshj","@type":"Person","name":"devanshj"},"datePublished":"2021-07-03T03:57:31Z","url":"https://github.com/microsoft/TypeScript/issues/44879"}
| 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:e1d5fd50-f2f0-7a7a-fd45-9b20b43df9a7 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9984:34DB8F:EB5CF5:13B0960:6B010EF8 |
| html-safe-nonce | 683d50ca6e54a9b752049a13d961651a4c2e0fc2ef52db10ae61438ecd7a4e57 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5OTg0OjM0REI4RjpFQjVDRjU6MTNCMDk2MDo2QjAxMEVGOCIsInZpc2l0b3JfaWQiOiI2ODc2MDYzOTg4MjA4ODAxMjAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | deaca69a3fb0b745cbf944eec81d5a49ebaa6e6d5d1e4e343dbe8a84655c7376 |
| hovercard-subject-tag | issue:936163494 |
| 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/44879/issue_layout |
| twitter:image | https://opengraph.githubassets.com/44d0eed7bac64cfcf9716b78b1adb1c9d9287d49bcb09e76bad7d105bf84e06e/microsoft/TypeScript/issues/44879 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/44d0eed7bac64cfcf9716b78b1adb1c9d9287d49bcb09e76bad7d105bf84e06e/microsoft/TypeScript/issues/44879 |
| og:image:alt | Bug Report 🔎 Search Terms intellisense, contextual inference, call site inference Related: #44821 🕗 Version & Regression Information Tested with v4.3.4 ⏯ Playground Link Playground 💻 Code m({ foo: ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | devanshj |
| 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