René's URL Explorer Experiment


Title: Improvement/Bug in contextual inference where the call-site is generic. · Issue #45035 · microsoft/TypeScript · GitHub

Open Graph Title: Improvement/Bug in contextual inference where the call-site is generic. · Issue #45035 · microsoft/TypeScript

X Title: Improvement/Bug in contextual inference where the call-site is generic. · Issue #45035 · microsoft/TypeScript

Description: Feature request / Bug report 🔍 Search Terms Contextual inference, generic call-site ✅ Viability Checklist My suggestion meets these guidelines: This wouldn't be a breaking change in existing TypeScript/JavaScript code This wouldn't chang...

Open Graph Description: Feature request / Bug report 🔍 Search Terms Contextual inference, generic call-site ✅ Viability Checklist My suggestion meets these guidelines: This wouldn't be a breaking change in existing TypeSc...

X Description: Feature request / Bug report 🔍 Search Terms Contextual inference, generic call-site ✅ Viability Checklist My suggestion meets these guidelines: This wouldn't be a breaking change in existing Ty...

Opengraph URL: https://github.com/microsoft/TypeScript/issues/45035

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Improvement/Bug in contextual inference where the call-site is generic.","articleBody":"# Feature request / Bug report\r\n\r\n## 🔍 Search Terms\r\n\r\nContextual inference, generic call-site\r\n\r\n## ✅ Viability Checklist\r\n\r\nMy suggestion meets these guidelines:\r\n\r\n- [x]  This wouldn't be a breaking change in existing TypeScript/JavaScript code\r\n- [x]  This wouldn't change the runtime behavior of existing JavaScript code\r\n- [x]  This could be implemented without emitting different JS based on the types of the expressions\r\n- [x]  This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)\r\n- [x]  This feature would agree with the rest of [TypeScript's Design Goals](https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals).\r\n\r\n## ⭐ Suggestion / Problem\r\n\r\nLet's first study contextual inference in different scenarios. [Playground](https://www.typescriptlang.org/play?jsx=0&ts=4.4.0-beta#code/C4TwDgpgBAGgPAFSgXigOwgNwgJwHwpQDeUAJAFxQBEAZgPZ1VQA+USAvgFAAmEAxgBs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S6VNtGhtenfIRKGmLK03GABWPLjrmoqeuRPrByu-z+SgR0UbquyMeybG9pbQFCbarsTsM9CbxYdA-sBnB+ckEAAboAQyeY-quReH7rwAC04ZsVclf4VAARx+vE3gZOgubQcQxL4GRJAgaAAGJpWlAAOAB2ABOLQ6dR9KGyIrRMZZ3HW0JmbicXejvJK3rIyWpTBpq+mtvq+yvagHGdF9mV9I6nm8Og-m0EF3ARbF-6Jal+TKYC+WFfL5WVdTNW-k17W+F19x9b9I3RBN8ZzagK3bcd52gp3B7TXxl73wAVWSN7UK-BA8FULGoHAyCb3vR94Jn4HKFHxGksdfG1JI9GHMcwEADYiYNwOtmKsNybDxSqYsmnd-32PxqatnxjPzmF0KoMfrQN4xwADuaAi4U3DtTMulcq4CXJHXHWesDat34KbTu3d7ZO2fjZA+akj6ejPv7C+v8tjBxvtLEuq1OJ72wbHD2788aSDPkdIhp0-4AOAaAxiodypcgfiOMuFcYEehrkMeBDdEEtzoMbVBltrYYK0EAA) for code below. **Highly recommended** to view it in the playground so that you can see where are the red underlines, what is the inference and what are the completions.\r\n\r\n```tsx\r\ntype X\u003cT = never> = { $: \"foo\" | T }\r\ndeclare const $1: \u003cZ>(x: Z) => { $: Z }\r\ndeclare const $2: \u003cZ>(x: NoInfer\u003cZ>) => { $: Z }\r\ntype NoInfer\u003cT> = [T][T extends any ? 0 : never]\r\n\r\nlet _: X;\r\n_ = $1(\"\")               // s1t1 - Z is inferred as \"\" and does not compile ........................ ok\r\n_ = $2(\"\")               // s1t2 - Z is inferred as \"foo\" and does not compile ..................... nice\r\n_ = $1(\"foo\")            // s1t3 - Z is inferred as \"foo\" and compiles ............................. ok\r\n_ = $2(\"foo\")            // s1t4 - Z is inferred as \"foo\" and compiles ............................. nice\r\n\r\ndeclare const m1: (x: X) => void\r\nm1($1(\"\"))               // s2t1 - Z is inferred as \"\" and does not compile ........................ ok\r\nm1($2(\"\"))               // s2t2 - Z is inferred as \"foo\" and does not compile ..................... nice\r\nm1($1(\"foo\"))            // s2t3 - Z is inferred as \"foo\" and compiles ............................. ok\r\nm1($2(\"foo\"))            // s2t4 - Z is inferred as \"foo\" and compiles ............................. nice\r\n\r\ndeclare const m2: \u003cT>(x: InferStringLiteral\u003cT>, _: X\u003cNoInfer\u003cT>>) => void\r\ntype InferStringLiteral\u003cT> = T extends string ? T : string\r\nm2(\"a\", $1(\"\"))          // s3t1 - Z is inferred as \"\" and does not compile ........................ ok\r\nm2(\"a\", $2(\"\"))          // s3t2 - Z is inferred as \"foo\" | \"a\" and does not compile ............... nice\r\nm2(\"a\", $1(\"foo\"))       // s3t3 - Z is inferred as \"foo\" and compiles ............................. ok\r\nm2(\"a\", $2(\"a\"))         // s3t4 - Z is inferred as \"foo\" | \"a\" and compiles ....................... nice\r\n\r\ndeclare const m3: (_: { x: X }) => void\r\nm3({ x: $1(\"\") })        // s4t1 - Z is inferred as \"\" and does not compile ........................ ok\r\nm3({ x: $2(\"\") })        // s4t2 - Z is inferred as \"foo\" and does not compile ..................... nice\r\nm3({ x: $1(\"foo\") })     // s4t3 - Z is inferred as \"foo\" and compiles ............................. ok\r\nm3({ x: $2(\"foo\") })     // s4t4 - Z is inferred as \"foo\" and compiles ............................. nice\r\n\r\ndeclare const m4: \u003cT extends { a?: number, x: X\u003ckeyof T> }>(_: T) => void\r\nm4({ x: $1(\"\"), a: 1 })  // s5t1 - Z is inferred as \"\" and does not compile ........................ ok \r\nm4({ x: $2(\"\"), a: 1 })  // s5t2 - Z is inferred as string | number | symbol and does not compile... ugh\r\n                         //        (quickinfo is incorrect see #44879)\r\nm4({ x: $1(\"a\"), a: 1 }) // s5t3 - Z is inferred as \"a\" and does not compile ....................... ok\r\nm4({ x: $2(\"a\"), a: 1 }) // s5t4 - Z is inferred as string | number | symbol and does not compile .. ughhh\r\n                         //        (quickinfo is incorrect see #44879)\r\n\r\ndeclare const m5: \u003cT, U extends X\u003cT>>(a: InferStringLiteral\u003cT>, x: U) => void\r\nm5(\"a\", $1(\"\"))          // s6t1 - Z is inferred as \"\" and does not compile ........................ ok \r\nm5(\"a\", $2(\"foo\"))       // s6t2 - Z is inferred as unknown and does not compile.................... ugh\r\n                         //        (quickinfo is incorrect see #44879)\r\nm5(\"a\", $1(\"a\"))         // s6t3 - Z is inferred as \"a\" and does not compile ....................... ok\r\nm5(\"a\", $2(\"a\"))         // s6t4 - Z is inferred as unknown and does not compile ................... ughhh\r\n                         //        (quickinfo is incorrect see #44879)\r\n```\r\n\r\n1. The contextual inference is expected and consistent for s1, s2, s3 & s4. But weird yet consistent for s5 & s6.\r\n2. I think the following should be the expected behavior...\r\n\r\n    ```\r\n    s5t2 - Z is inferred as \"foo\" | \"a\" | \"x\" and does not compile\r\n    s5t4 - Z is inferred as \"foo\" | \"a\" | \"x\" and compiles\r\n    s6t2 - Z is inferred as \"foo\" | \"a\" and does not compile\r\n    s6t4 - Z is inferred as \"foo\" | \"a\" and compiles\r\n    ```\r\n\r\n3. In s5t4 & s6t4, `\"a\"` is one of the completions but they are incorrect because the language server infers the type parameter different from the compiler. This is most probably a bug which might be accommodated in [#44879](https://github.com/microsoft/TypeScript/issues/44879). So all in all the completions are useless and when the language server is fixed there would be no completions.\r\n4. Generally speaking, a sugar-like abstraction should not result in compromises in developer experience. If you inline `$*(\"\")`  as `{ $: \"\" }` in s5 & s6 then the completions and the compiler would work as expected.\r\n5. My analysis is that when the type expected from calling  `$*` is generic itself (ie s5 & s6) then compiler can't infer the type parameter `Z` correctly. It resolves all other generics to `unknown` hence the type parameter `Z` is inferred as  `keyof unknown` and `unknown` in s5 and s6, respectively.\u003cbr/>\r\nAside: Though I would expected other generics to resolve to their constraint meaning I'd have expected (like not ultimately but considering the weirdness itself) the type parameter of `$2` in the following scenario as `\"a\" | \"b\"` instead of `unknown`. [Playground](https://www.typescriptlang.org/play?jsx=0&ts=4.4.0-beta#code/C4TwDgpgBAGgPAFSgXigOwgNwgJwHwpQDeUAJAFxRIA+UARAGYD2TdUAvgFAAmEAxgBsAhjmh8maAM7AoAWwBslRFAgAPYBDTdJ9IW1p0ARnQA0UAKor1m7bER48ACiGUEZ1ZXMBKFAUxMAS25OBUc6PTNSACYwvS8fAHoEqAAtKACdALQGXFFuKCEdAFc0AGs0JgB3NE4efmFRKHEpGWilFKcPKAA5JgBJbNw4Dp9kAhIKVI5OUEge-sGce0IAbQQAXTWrDS0dITQQKAB+KAAGKEoMbBx1oA).\r\n\r\n    ```tsx\r\n    type X\u003cT = never> = { $: T | \"foo\" }\r\n    declare const m6: \u003cT extends \"a\" | \"b\", U extends X\u003cT>>(a: T, x: U) => void\r\n    m6(\"a\", $2(\"a\")) // Z is inferred as unknown\r\n\r\n    declare const $2: \u003cZ>(x: NoInfer\u003cZ>) => { $: Z }\r\n    type NoInfer\u003cT> = [T][T extends any ? 0 : never]\r\n    ```\r\n\r\n6. [#44999](https://github.com/microsoft/TypeScript/issues/44999) is most probably the consequence of this weirdness as it fits the precondition and it's marked as a bug, so imo this should be also be considered as a bug. It's not apparent because the repros are vague but hopefully the following examples would make it more clear how essential it is to get this right.\r\n7. Maybe `$1`should work same as `$2`\r\n\r\n## 📃 Motivating Example\r\n\r\nLibrary authors provide sugar-like abstractions all the time. Take the following as an example. [Playground](https://www.typescriptlang.org/play?jsx=0&ts=4.4.0-beta#code/MYJwpghgLmDCD2AbeIDOAKA3gKAAS4CMJUwAuXTXABxAEsBbCEAT3ICJwATN3AXwBo8uTmDoA3MJ3I58+GgybMALAAYV5RLQDmACxgA7AOq0oOgHLwAkvoBmo9G3mMWbfrhUA6JQEpBs6nTOzACsahraemBGJjrwAK5QFtZ2IA5Oiq7uHsG+QnKBigBsYbiaugbGpvGJVrb2jgUuuMS4wPD6qFBunoW5-uksAOwlZZHRVQlJdSCVOsmiAMpQdPpaADImohCIaY3MmZ6D3kK82LzH2CLAiExgre2dreDQcEgoqOQAPLC4YAAeBk4qFwnRWWgAfOhTGB6GQhJQiCRpLgANptZAgSwifRQWg2WiiXC0fS4WAAXXICAxfCEbhE4kk5DyskoKPptAknCpKCJJNBxK0FNwzP8+ARxDIuCmKW+4NwAHp5bgAAbS0TKkHwXCmaAq2Aa2jA4kpLi4dqIZi4GwgeD0FWIsDKkWitzwKhbXHtcjoYCUt4gby4AC8cu5IGd-lOopp+HOwblbAAKgB5AAiybY2EuYGut3uHSgpQiFRiapApCEnwAWpCHeQy9XwW4AO5gYvkfRxegEUSBkPC-zipG4KvM13ukDQWhe3A+v0Yvuh-3M07Z3PgfOPUYliY1eblys19B1kcttvlDtdnsB+MDlmECXkUf+cce6f6b2+0n+xffjErrMrhuDc2gLItyiiWZqjLWZ9yWMENhgSdEArfBG2PR9cDg5YBUQrZEEbM921wTtu17W9mSHSVn1kV9J09D9Zy-MNfzDAD8GwKBmHdP8eSDEEcNWABuTjuLuBtEzlfiUUTMkZN+AEoiBZp9EtAB+dxcA7MAJBAMlRJ47CEM2ZDPkk4NcETBTAWBflVlwDSrO03SgA).\r\n\r\n```tsx\r\ncreateColors({\r\n  base: { primary: \"red\" },\r\n  derived: {\r\n    primary400: lightenWithNoInfer(\"primary\", 0.4), // does not compile\r\n    primary500: lightenWithoutNoInfer(\"primary\", 0.5), // does not compile\r\n    primary600: lightenWithoutNoInfer(\"primary\" as const, 0.6),\r\n    primary700: lightenWithoutNoInferWithInferStringLiteral(\"primary\", 0.7)\r\n  }\r\n})\r\n\r\ndeclare const createColors: \u003cC extends string>(theme:\r\n  { base: { [colorIdentifier in C]: Color }\r\n  , derived: \r\n      { [derivedColor in string]: \r\n          { base: NoInfer\u003cC> // `NoInfer` so that `C` is inferred only from `base`\r\n          , operation: (c: Color) => Color\r\n          }\r\n      }\r\n  }) => \"TODO\"\r\n\r\ndeclare const lightenWithNoInfer:\r\n  \u003cZ>(base: NoInfer\u003cZ>, weight: number) => \r\n    { base: Z\r\n    , operation: (c: Color) => Color\r\n    }\r\n\r\ndeclare const lightenWithoutNoInfer:\r\n  \u003cZ>(base: Z, weight: number) => \r\n    { base: Z\r\n    , operation: (c: Color) => Color\r\n    }\r\n\r\ndeclare const lightenWithoutNoInferWithInferStringLiteral:\r\n  \u003cZ>(base: InferStringLiteral\u003cZ>, weight: number) => \r\n    { base: Z\r\n    , operation: (c: Color) => Color\r\n    }\r\n  \r\ntype Color = string;\r\ntype NoInfer\u003cT> = [T][T extends any ? 0 : never]\r\ntype InferStringLiteral\u003cT> = T extends string ? T : never\r\n```\r\n\r\nNone of the `lighten` version is good.\r\n\r\n1. `lightenWithNoInfer` has completions but are incorrect and doesn't compile\r\n2. `lightenWithoutNoInfer` infers `Z` as `string` instead of `\"primary\"` hence doesn't compile\r\n3. `lightenWithoutNoInferWithInferStringLiteral` compiles but has no completions\r\n\r\nIf I were to be frank, there is no rocket science going on here, `lightenWithoutNoInfer` (or at least `lightenWithNoInfer`) should \"just work\" with completions and compilation.\r\n\r\nAnd the problem isn't about string literals per se. Here's another real world example from xstate. [Playground](https://www.typescriptlang.org/play?jsx=0&ts=4.4.0-beta#code/MYJwpghgLmCyHABYEsB2YAUBvAUAAjwGckwBbCALjyzzADcxUorRIYBlE8gHhqgE8ADmCoAiAGIBRACoBhABKi8AXwB8GAJQqANPjxpkUZBAA2Y5ABMTYUboKEo0MISq4CBS9dd73tJiH4qQkYLbDwBYTEpOUUVDTtfPAB7VG9E92iFMQAzMCgkNABzUR93ZVLlBIJc-JRUQtdygnLlDRwcCzBgEwhwPGAUh37wJ3gC9CpudkcYWgAPGFQLQiIoECLtPEkGJnnF5epwoRFV9fqVdVIKPRpiRDJKQ-pGZi2dqBU8AHovvAB3MD-CC7AAG2xeIPCSTwACNAWhciBwBZkqgTPw8NkQElSHh7uA9JsDEZTFQAHJJACSqERUxmYFUhNWThcpRoAG12PpUHhpk4ALpUH7-QF-YEfEF8mCQqDQuHcxHI1HozHY3H4sClXw0F4BAD8VC1iQAPocIidRHMHE4AHTBJYldLpTbPJjkqk0sAgbjgpiMp2JJqJTYpA1G7V4dmSblvF7s0Tm0T8-kGvAU6m0qUM8NlI1B5p6Vp4AC8qjwdCSlnanW6vUBA1QQ3tFmuBB96ldr3Tnu9klUWlLZuOYit9LtIVstHeVGj5Q6XR6fQbQ1YTk493Ik2k6gHZekOHNaY9tO3Jcj0n57OkexCK2BGL1eAADHgqOgGCB+QBuIA).\r\n\r\n```tsx\r\ncreateMachine({\r\n  schema: { event: createSchema\u003c{ type: \"FETCH\" }>() },\r\n  initial: \"idle\",\r\n  states: {\r\n    idle: {\r\n      entry: send({ type: \"FETCH\" }), // does not compile\r\n      on: {\r\n        FETCH: \"fetching\"\r\n      }\r\n    },\r\n    fetching: {}\r\n  }\r\n})\r\n\r\ndeclare const createMachine: \u003cState extends string, Event extends { type: string }>(m:\r\n  { schema: { event: Event } // we want `Event` to be inferred only from here\r\n  , initial: NoInfer\u003cState>\r\n  , states:\r\n    { [S in State]: // we want `State` to be inferred only from here\r\n        { entry?: \r\n          | { type: \"xstate.send\"\r\n            , event: NoInfer\u003cEvent>\r\n            }\r\n      , on?:\r\n          { [E in Event[\"type\"]]?: NoInfer\u003cState>\r\n          }\r\n      }\r\n    }\r\n  }) => void\r\n\r\ndeclare const send:\r\n  \u003cE>(event: NoInfer\u003cE>) => { type: \"xstate.send\", event: E }\r\n\r\ndeclare const createSchema: \u003cT>() => T\r\ntype NoInfer\u003cT> = [T][T extends any ? 0 : never];\r\n```\r\n\r\nThe problem exactly is same as above. And here you can even inline `send({ type: \"FETCH\" })` to `{ type: \"xstate.send\", type: \"FETCH\" }` and it compiles and even provides completions. \r\n\r\nAside: If we add `{ type: string }` to the `entry` union `send(\"\")` [compiles](https://www.typescriptlang.org/play?jsx=0&ts=4.4.0-beta#code/MYJwpghgLmCyHABYEsB2YAUBvAUAAjwGckwBbCALjyzzADcxUorRIYBlE8gHhqgE8ADmCoAiAGIBRACoBhABKi8AXwB8GAJQqANPjxpkUZBAA2Y5ABMTYUboKEo0MISq4CBS9dd73tJiH4qQkYLbDwBYTElZQ07XzwAe1RvePcpOXkxADMwKCQ0AHNRH3dlEuU4ghy8lFQC1zKCMpicHAswYBMIcDxgJIde8Cd4fPQqbnZHGFoADxhUC0IiKBBC7TxJBiZZ+cXqcKERZdW6lXVSCj0aYkQySn36RmYNragVPAB6D7wAdzBfiDbAAGmyeQPCCTwACN-mgciBwBZEqgTPw8FkQAlSHhbuA9OsDEZTFQAHIJACSqHhEymYFU+OWThcJRoAG12PpUHhJk4ALpUL6-f4-QFvIE8mDgqCQmGc+GI5Go9GY7G4sAlXw0J4BAD8VA18QAPvsIkcHCcCioDb5jXxDmIZg4nAA6YILYqpVLrR5MUkUqlgEDcUFMeme+KNeLrJJ663uNmSTkvJ6s0Sm0S83l6vBkynUiV0uNNA2R4tNLQAXlUeDoCUsrXanW6-z6qAGboslwIwfUPueuYDQckqkr1btkTwokdtNdIVstFeVETZTaHS6PVbA1YTk4t3I42k6lHeGkOFNOf91MPeAreFZ0l5952ISWgLROrwAAY8FR0AwQLyADcQA) but `{ type: \"xstate.send\", event: \"\" }` [doesn't](https://www.typescriptlang.org/play?jsx=0&ts=4.4.0-beta#code/MYJwpghgLmCyHABYEsB2YAUBvAUAAjwGckwBbCALjyzzADcxUorRIYBlE8gHhqgE8ADmCoAiAGIBRACoBhABKi8AXwB8GAJQqANPjxpkUZBAA2Y5ABMTYUboKEo0MISq4CBS9dd73tJiH5XPAFhMQAPBycAOkJGC1taBiYgkJE8USVlHR93AHtUb19fKTl5MQAzMCgkNABzURyCZRzlO3dK6pRUWtdmppxlDRwcCzBgEwhwPGB8h2nwJ3ga9CpudkcYWjCYVAtCIigQOu08SSSoLZ296mChNIcj7pV1Ugo9GmJEMkob+kZmU7nFR4AD0ILwAHcwJCIEw8AADM7-eHBXJ4ABG0LQlRA4AseHyJn4eHKIFypDwX3AehOBiMpioADlcgBJVA4tYbMCqGkHJwuHI0ADa7H0qDw6ycAF0qGDIdCIbCLvDJTAUVA0ZixTi8QTUESSWSKVSwI13DR-gEAPxUM2+AA+N1SVAedRUdvcjr4d3CkRgMTiDSKwbwJz+yTwzLZHKRTB5IaKfSKJ3yNo9BGFkjFgP+QtEqVEUqlNsjrPZYBAnKc8YT7uDSf6TS0AF5VHg6LlLMNRuNJtCZqg5rFdm8CNxJOpwwCo+XKxOW23vaF0hEuQHdgkp1Qs80RmMJlMB3NWE5OF9yKtpOoF3hpDhUqXoxXuFe8M28ELpFLP5c4vtYcSVp4AADHgVDoAwIBSgA3EAA), which is kinda weird too because both are equivalent.\r\n\r\n## 💻 Use Cases\r\n\r\nAny case where the type parameters of a function are to be inferred from the return type instead of parameters AND location of the function call is a generic; is a use case. I suspect this improvement/bugfix will have a huge impact especially for library authors. Probably there are some folks out there banging theirs heads to make the completions work when they should probably \"just work\" without having to do anything.\r\n\r\n### Some \"workarounds\"\r\n\r\nFor s5\r\n\r\n```tsx\r\ndeclare const $:\r\n  \u003c R\r\n  , Z extends R extends { $: infer X } ? X : never>\r\n    (x: Z) => R & { $: Z }\r\n```\r\n\r\nFor `lighten`\r\n\r\n```tsx\r\ndeclare const lighten:\r\n  \u003c R\r\n  , C extends R extends { base: infer X } ? X : never>\r\n    (base: C, weight: number) => \r\n      & R\r\n      & { base: C\r\n        , operation: (c: Color) => Color\r\n        }\r\n```\r\n\r\nFor `send`\r\n\r\n```tsx\r\ndeclare const send:\r\n  \u003c R\r\n  , E extends R extends { event: infer X } ? X : never>\r\n    (event: E) =>\r\n      & R\r\n      & { type: \"xstate.send\", event: E }\r\n```\r\n\r\nAll the above provide completions and compile too. Though complex cases like s4 don't work with this workaround.\r\n\r\nThanks for reading!","author":{"url":"https://github.com/devanshj","@type":"Person","name":"devanshj"},"datePublished":"2021-07-15T02:14:05Z","url":"https://github.com/microsoft/TypeScript/issues/45035"}

react-profiling0
react-import-mapreact,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-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:9f087771-d388-148d-aaac-8c228d7a0fa9
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idDF76:19E4BB:9BFCFB:C8CE42:6B00F19C
html-safe-nonce7a063126ba8f1b8638178fd62f03f9c53059b767dbac54a5223acda1ab66aacb
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERjc2OjE5RTRCQjo5QkZDRkI6QzhDRTQyOjZCMDBGMTlDIiwidmlzaXRvcl9pZCI6IjgwNTE4NDUwNzUwMTkyOTcxODEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacbaa07df0765afd1c48445fad27d7249016791c9d2f8922d58a94949df42a92d6
hovercard-subject-tagissue:944931938
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/TypeScript/45035/issue_layout
twitter:imagehttps://opengraph.githubassets.com/3fe4ea9aa7afc8ac6ed9b3b907bd0fa0be670c3b130c0af32e78bebf322792fa/microsoft/TypeScript/issues/45035
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/3fe4ea9aa7afc8ac6ed9b3b907bd0fa0be670c3b130c0af32e78bebf322792fa/microsoft/TypeScript/issues/45035
og:image:altFeature request / Bug report 🔍 Search Terms Contextual inference, generic call-site ✅ Viability Checklist My suggestion meets these guidelines: This wouldn't be a breaking change in existing TypeSc...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamedevanshj
hostnamegithub.com
expected-hostnamegithub.com
None4ef498cbabcbe3c50befc7a5b743e7072ee770b4daf0e15e54801180d1fa91fc
turbo-cache-controlno-preview
go-importgithub.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git
octolytics-dimension-user_id6154722
octolytics-dimension-user_loginmicrosoft
octolytics-dimension-repository_id20929025
octolytics-dimension-repository_nwomicrosoft/TypeScript
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id20929025
octolytics-dimension-repository_network_root_nwomicrosoft/TypeScript
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release9983dd5da06943f833c971dd5b6bc988e2858be5
ui-targetcanary-2
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/microsoft/TypeScript/issues/45035#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F45035
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F45035
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=microsoft%2FTypeScript
Reloadhttps://github.com/microsoft/TypeScript/issues/45035
Reloadhttps://github.com/microsoft/TypeScript/issues/45035
Reloadhttps://github.com/microsoft/TypeScript/issues/45035
microsofthttps://github.com/microsoft
TypeScripthttps://github.com/microsoft/TypeScript
Codehttps://github.com/microsoft/TypeScript
Issues5k (5k)https://github.com/microsoft/TypeScript/issues
Pull requests308 (308)https://github.com/microsoft/TypeScript/pulls
Actionshttps://github.com/microsoft/TypeScript/actions
Projectshttps://github.com/microsoft/TypeScript/projects
Wikihttps://github.com/microsoft/TypeScript/wiki
Security and qualityhttps://github.com/microsoft/TypeScript/security
Insightshttps://github.com/microsoft/TypeScript/insights
https://github.com/microsoft/TypeScript
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/45035
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/45035
Improvement/Bug in contextual inference where the call-site is generic.https://github.com/microsoft/TypeScript/issues/45035#top
In DiscussionNot yet reached consensushttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22In%20Discussion%22
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
https://github.com/devanshj
Devansh Jethmalani (devanshj)https://github.com/devanshj
on Jul 15, 2021https://github.com/microsoft/TypeScript/issues/45035#issue-944931938
TypeScript's Design Goalshttps://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals
Playgroundhttps://www.typescriptlang.org/play?jsx=0&ts=4.4.0-beta#code/C4TwDgpgBAGgPAFSgXigOwgNwgJwHwpQDeUAJAFxQBEAZgPZ1VQA+USAvgFAAmEAxgBsAhjmh86aAM7AyARkpwAWngAUAD0qKAlCgIkKURVC69BIsROlkATAuXrKAOToBJNDVxK8O5HrKbjTlBIKGc3DxxEAlQAbQQAXTioCDVgCDRuSSghNBAoAH4oAAYoSgxsHHjOTgEIGQB9ShgAbk56wlJZFSoqHSh+gcHBgHphqElZYFkoAFpDKABLLIX3XFFubKye7IyobjoILLQ6GXEAWzAF2qgAOjv7h8en+6g6AGs2jutu3qG-kbGE2A1lm8yWi1WOHWm2o9EYOw2+0O6BOUHOl2uzyxT3QCz4EE+qE63Thv3+APGkwAzKCjOCVhFoUItqSEWi6BcrsjsTyea8Pu0id9aAwyeT+qNKcAACy0xbLSFMlmitnorlZXmanFoPEEnj8YSidlSGRneRQBywHwETB0BbcThmlTEnpaPriimSaxTOX0xUQDbM6hMHKIg5HVFqzFavnvR1dUjC3ruj0S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LEuq1OJ72wbHD2788aSDPkdIhp0-4AOAaAxiodypcgfiOMuFcYEehrkMeBDdEEtzoMbVBltrYYK0EAA
#44879https://github.com/microsoft/TypeScript/issues/44879
Playgroundhttps://www.typescriptlang.org/play?jsx=0&ts=4.4.0-beta#code/C4TwDgpgBAGgPAFSgXigOwgNwgJwHwpQDeUAJAFxRIA+UARAGYD2TdUAvgFAAmEAxgBsAhjmh8maAM7AoAWwBslRFAgAPYBDTdJ9IW1p0ARnQA0UAKor1m7bER48ACiGUEZ1ZXMBKFAUxMAS25OBUc6PTNSACYwvS8fAHoEqAAtKACdALQGXFFuKCEdAFc0AGs0JgB3NE4efmFRKHEpGWilFKcPKAA5JgBJbNw4Dp9kAhIKVI5OUEge-sGce0IAbQQAXTWrDS0dITQQKAB+KAAGKEoMbBx1oA
#44999https://github.com/microsoft/TypeScript/issues/44999
Playgroundhttps://www.typescriptlang.org/play?jsx=0&ts=4.4.0-beta#code/MYJwpghgLmDCD2AbeIDOAKA3gKAAS4CMJUwAuXTXABxAEsBbCEAT3ICJwATN3AXwBo8uTmDoA3MJ3I58+GgybMALAAYV5RLQDmACxgA7AOq0oOgHLwAkvoBmo9G3mMWbfrhUA6JQEpBs6nTOzACsahraemBGJjrwAK5QFtZ2IA5Oiq7uHsG+QnKBigBsYbiaugbGpvGJVrb2jgUuuMS4wPD6qFBunoW5-uksAOwlZZHRVQlJdSCVOsmiAMpQdPpaADImohCIaY3MmZ6D3kK82LzH2CLAiExgre2dreDQcEgoqOQAPLC4YAAeBk4qFwnRWWgAfOhTGB6GQhJQiCRpLgANptZAgSwifRQWg2WiiXC0fS4WAAXXICAxfCEbhE4kk5DyskoKPptAknCpKCJJNBxK0FNwzP8+ARxDIuCmKW+4NwAHp5bgAAbS0TKkHwXCmaAq2Aa2jA4kpLi4dqIZi4GwgeD0FWIsDKkWitzwKhbXHtcjoYCUt4gby4AC8cu5IGd-lOopp+HOwblbAAKgB5AAiybY2EuYGut3uHSgpQiFRiapApCEnwAWpCHeQy9XwW4AO5gYvkfRxegEUSBkPC-zipG4KvM13ukDQWhe3A+v0Yvuh-3M07Z3PgfOPUYliY1eblys19B1kcttvlDtdnsB+MDlmECXkUf+cce6f6b2+0n+xffjErrMrhuDc2gLItyiiWZqjLWZ9yWMENhgSdEArfBG2PR9cDg5YBUQrZEEbM921wTtu17W9mSHSVn1kV9J09D9Zy-MNfzDAD8GwKBmHdP8eSDEEcNWABuTjuLuBtEzlfiUUTMkZN+AEoiBZp9EtAB+dxcA7MAJBAMlRJ47CEM2ZDPkk4NcETBTAWBflVlwDSrO03SgA
Playgroundhttps://www.typescriptlang.org/play?jsx=0&ts=4.4.0-beta#code/MYJwpghgLmCyHABYEsB2YAUBvAUAAjwGckwBbCALjyzzADcxUorRIYBlE8gHhqgE8ADmCoAiAGIBRACoBhABKi8AXwB8GAJQqANPjxpkUZBAA2Y5ABMTYUboKEo0MISq4CBS9dd73tJiH4qQkYLbDwBYTEpOUUVDTtfPAB7VG9E92iFMQAzMCgkNABzUR93ZVLlBIJc-JRUQtdygnLlDRwcCzBgEwhwPGAUh37wJ3gC9CpudkcYWgAPGFQLQiIoECLtPEkGJnnF5epwoRFV9fqVdVIKPRpiRDJKQ-pGZi2dqBU8AHovvAB3MD-CC7AAG2xeIPCSTwACNAWhciBwBZkqgTPw8NkQElSHh7uA9JsDEZTFQAHJJACSqERUxmYFUhNWThcpRoAG12PpUHhpk4ALpUH7-QF-YEfEF8mCQqDQuHcxHI1HozHY3H4sClXw0F4BAD8VC1iQAPocIidRHMHE4AHTBJYldLpTbPJjkqk0sAgbjgpiMp2JJqJTYpA1G7V4dmSblvF7s0Tm0T8-kGvAU6m0qUM8NlI1B5p6Vp4AC8qjwdCSlnanW6vUBA1QQ3tFmuBB96ldr3Tnu9klUWlLZuOYit9LtIVstHeVGj5Q6XR6fQbQ1YTk493Ik2k6gHZekOHNaY9tO3Jcj0n57OkexCK2BGL1eAADHgqOgGCB+QBuIA
compileshttps://www.typescriptlang.org/play?jsx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ADM7-eHBXJ4ABG0LQlRA4AseHyJn4eHKIFypDwX3AehOBiMpioADlcgBJVA4tYbMCqGkHJwuHI0ADa7H0qDw6ycAF0qGDIdCIbCLvDJTAUVA0ZixTi8QTUESSWSKVSwI13DR-gEAPxUM2+AA+N1SVAedRUdvcjr4d3CkRgMTiDSKwbwJz+yTwzLZHKRTB5IaKfSKJ3yNo9BGFkjFgP+QtEqVEUqlNsjrPZYBAnKc8YT7uDSf6TS0AF5VHg6LlLMNRuNJtCZqg5rFdm8CNxJOpwwCo+XKxOW23vaF0hEuQHdgkp1Qs80RmMJlMB3NWE5OF9yKtpOoF3hpDhUqXoxXuFe8M28ELpFLP5c4vtYcSVp4AADHgVDoAwIBSgA3EAA
Devansh Jethmalani (devanshj)https://github.com/devanshj
on Jul 15, 2021https://github.com/microsoft/TypeScript/issues/45035#event-5022811419
https://github.com/devanshj
Devansh Jethmalani (devanshj)https://github.com/devanshj
on Jul 15, 2021https://github.com/microsoft/TypeScript/issues/45035#issuecomment-880888251
https://github.com/RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
on Jul 16, 2021https://github.com/microsoft/TypeScript/issues/45035#issuecomment-881623250
https://github.com/devanshj
Devansh Jethmalani (devanshj)https://github.com/devanshj
on Jul 16, 2021https://github.com/microsoft/TypeScript/issues/45035#issuecomment-881632888
https://github.com/fatcerberus
Bruce Pascoe (fatcerberus)https://github.com/fatcerberus
on Jul 16, 2021https://github.com/microsoft/TypeScript/issues/45035#issuecomment-881655535
https://github.com/devanshj
Devansh Jethmalani (devanshj)https://github.com/devanshj
on Jul 16, 2021https://github.com/microsoft/TypeScript/issues/45035#issuecomment-881665429
https://github.com/RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
on Jul 16, 2021https://github.com/microsoft/TypeScript/issues/45035#issuecomment-881666583
https://github.com/devanshj
Devansh Jethmalani (devanshj)https://github.com/devanshj
on Jul 16, 2021https://github.com/microsoft/TypeScript/issues/45035#issuecomment-881668322
https://github.com/fatcerberus
Bruce Pascoe (fatcerberus)https://github.com/fatcerberus
on Jul 16, 2021https://github.com/microsoft/TypeScript/issues/45035#issuecomment-881691668
https://github.com/devanshj
Devansh Jethmalani (devanshj)https://github.com/devanshj
on Jul 20, 2021https://github.com/microsoft/TypeScript/issues/45035#issuecomment-883721610
herehttps://github.com/microsoft/TypeScript/issues/44999#issuecomment-883717710
#45035https://github.com/microsoft/TypeScript/issues/45035
#45035https://github.com/microsoft/TypeScript/issues/45035
https://github.com/devanshj
Devansh Jethmalani (devanshj)https://github.com/devanshj
on Jul 22, 2021https://github.com/microsoft/TypeScript/issues/45035#issuecomment-884733595
Ryan Cavanaugh (@RyanCavanaugh)https://github.com/RyanCavanaugh
https://github.com/RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
on Jul 22, 2021https://github.com/microsoft/TypeScript/issues/45035#issuecomment-885128391
https://github.com/devanshj
Devansh Jethmalani (devanshj)https://github.com/devanshj
on Jul 22, 2021https://github.com/microsoft/TypeScript/issues/45035#issuecomment-885138434
this onehttps://github.com/microsoft/TypeScript/issues/45035#issuecomment-880888251
https://github.com/RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
on Jul 22, 2021https://github.com/microsoft/TypeScript/issues/45035#issuecomment-885145039
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
In DiscussionNot yet reached consensushttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22In%20Discussion%22
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
on Jul 22, 2021https://github.com/microsoft/TypeScript/issues/45035#event-5057451560
https://github.com/devanshj
Devansh Jethmalani (devanshj)https://github.com/devanshj
on Jul 22, 2021https://github.com/microsoft/TypeScript/issues/45035#issuecomment-885146549
https://github.com/devanshj
Devansh Jethmalani (devanshj)https://github.com/devanshj
on Nov 17, 2021https://github.com/microsoft/TypeScript/issues/45035#issuecomment-971141940
zustandhttps://github.com/pmndrs/zustand/
https://github.com/Andarist
Mateusz Burzyński (Andarist)https://github.com/Andarist
on Jan 7, 2023https://github.com/microsoft/TypeScript/issues/45035#issuecomment-1374600729
herehttps://github.com/microsoft/TypeScript/issues/45035#issuecomment-880888251
TS playgroundhttps://www.typescriptlang.org/play?jsx=0&ts=4.7.4#code/CYUwxgNghgTiAEYD2A7AzgF3gWwFzwB4AVeEADwxBWDXgG94ASfAIihfgB94WAjDgL4A+ABRl8RAJTwAvEPhEAUKEiwEydFmaEAWqPHwd0ufSb4d8AYsUB6G-CgBXDEmTYADhBCV4AdyQwANZoil5YZLI4IowiLCySktZ28LzO8ACWWMBIIGgoAORYGACe7uAAFuCBod7wxZHY0bHsCYpAA
#48410https://github.com/microsoft/TypeScript/pull/48410
Ryan Cavanaugh (@RyanCavanaugh)https://github.com/RyanCavanaugh
this commenthttps://github.com/microsoft/TypeScript/issues/45035#issuecomment-885128391
TS playgroundhttps://www.typescriptlang.org/play?jsx=0&ts=4.8.4#code/CYUwxgNghgTiAEYD2A7AzgF3gWwFzwB4AVeEADwxBWDXgG94ASfAIihfgB94WAjDgL4A+ABRl8RAJTwAvEPhEA3AChQkWAmToszQgC1R4+Hulz6TfHvgCVygPR34UAK4YkybAAcIISvADuSDAA1mjKPlhksjgijCIsLJKStg5O1PAAllgYAJ6e4AAW4KEAhOG+8DnR2LHx7EkpjgC0LcrKufnwAEJIZMTyMuYAblAQziAS1ipq0HDwAGbOKGAYGajwvL39YhKS+D19RELT4LMIi8ur6yBQGHogMEgHAOLEpBRUNN1bAAxChrt8EMkBlgI14BgChlaB1CsVaFBaP4QBAIMobncHk9es8RJsyCIfg02qkWk02rD4ABhJAQILRTAwDIoADmKkpADkkABJFDzB79aIAbSIAF0Re9KNQESgqgB+eA-eD4FAgIYPUW2GYaRCoTCIOC3EA0ukwND4AhUyWfWiM5ks0SQkDYCb0ZTwDaI10MIXIU3c0AoVbzDIPTIoami-Am+k2d3wUBM9XAfB0eMeoWJjLJmMwcPwO2sqNuj2lz1oV1c3n8mCW47wVIAAyrfIejYLSAhBVu8EbVPb0PDNbgwHgqAgVXmj2wvd4Xsb6dLSHyMFuaxQ+BEYGjtKCpnkuZUZbjHrjAn3PCIAHkACJXlha046rT6iAZFkFKUAdSyBRbNYtAwRHjOcK3wf8BQMAAaeNkXfT8VWcbBeAeZQLwYUDXT0RQxxXNdUE3bdqV3GAL1zKY2m1OYXywN8P2-X8kFcCCYEA0QQK9SwYI9OD6MQ5DUPQ8ssJw5cHnwjd4C3HdTTIkiKOUMBDUoXM0BENMPUw1N4E8JlsFgHJWBHQRuITB5sxAFMS1LXSMn0mAcgAVh+H58Doz8qB-SEmIwFj4ls+ychYKDFQAOkcyQQtSSFB1QBBAhCWgUCQfxFwCgyABYXLc+CGMhPyWHShzgrCjLIobRxeFcLtYtVAtVlRBMkBANAg3jAQYPPFQgA
#49086https://github.com/microsoft/TypeScript/pull/49086
Devansh Jethmalani (@devanshj)https://github.com/devanshj
TS playgroundhttps://www.typescriptlang.org/play?jsx=0&ts=4.8.4#code/CYUwxgNghgTiAEYD2A7AzgF3gWwFzwB4AVeEADwxBWDXgG94ASfAIihfgB94WAjDgL4A+ABRl8RAJTwAvEPhEA3AChQkWAmToszQgC1R4+Hulz6TfHvgCVygPR34UMBgCuUCMdYt7j8gAdwSmAvHnYuHn5lCBAsMlkcEUYRFhZJSUV4B1IYGCQYWmRcoIgAT2VlIA
https://github.com/devanshj
Devansh Jethmalani (devanshj)https://github.com/devanshj
on Jan 7, 2023https://github.com/microsoft/TypeScript/issues/45035#issuecomment-1374624219
this casehttps://www.typescriptlang.org/play?jsx=0&ts=4.9.4#code/MYJwpghgLmCyHABYEsB2YAUBvAUAAjwGckwBbCALjyzzADcxUorRIYBlE8gHhqgE8ADmCoAiAGIBRACoBhABKi8AXwB8GAJQqANPjxpkUZBAA2Y5ABMTYUboKEo0MISq4CBS9dd73tJiH4qQkYLbDwBYTEpOUUVDTtfPAB7VG9E92iFMQAzMCgkNABzUR93ZVLlBIJc-JRUQtdygnLlDRwcCzBgEwhwPGAUh37wJ3gC9CpudkcYWgAPGFQLQiIoECLtPEkGJnnF5epwoRFV9fqVdVIKPRpiRDJKQ-pGZi2dqBU8AHovvAB3MD-CC7AAG2xeIPCSTwACNAWhciBwBZkqgTPw8NkQElSHh7uA9JsDEZTFQAHJJACSqERUxmYFUhNWThcpRoAG12PpUHhpk4ALpUH7-QF-YEfEF8mCQqDQuHcxHI1HozHY3H4sClXw0F4BAD8VC1iQAPocIidRHMHE4AHTBJYldLpTbPJjkqk0sAgbjgpiMp2JJqJTYpA1G7V4dmSblvF7s0Tm0T8-kGvAU6m0qUM8NlI1B5p6Vp4AC8qjwdCSlnanW6vUBA1QQ3tFmuBB96ldr0kWlLZuOYit9LtIVstHeVGj5Q6XR6fQbQ1YTk493Ik2k6h7ZekOHNaY9tPXJcj0n57OkexCK2BGL1eAADHgqOgGCB+QBuIA
only (2) was fulfilledhttps://www.typescriptlang.org/play?jsx=0&ts=4.4.0-beta#code/CYUwxgNghgTiAEYD2A7AzgF3gWwFzwB4AVeEADwxBWDXgG94ASfAIihfgB94WAjDgL4A+ABRl8RAJTwAvEPhEAUKEiwEydFmaEAWqPHwd0ufSb4d8AYsUQQWMrJwjGIli0mTFAei-wAjAB08AAGOsHwaAAWSACuEMDwvAjBbBzcfCzhIsgwSBDQMACe8AC08DFoIDAR0XEJAOZ2POzwUNQ8-K20yNgADrYYAJaoaJ4+8ABMQcEYhb0gSABm8GThUbHxickM2qlcHYLB1gPwxTJOLqke3r4AzNNhNRsJSSGpR+MALNOz80una1qm1ewR2rBaAmCQA
(3) & (4) also have been fulfilled and (1) remains unfulfilledhttps://www.typescriptlang.org/play?jsx=0&ts=4.9.4#code/CYUwxgNghgTiAEYD2A7AzgF3gWwFzwB4AVeEADwxBWDXgG94ASfAIihfgB94WAjDgL4A+ABRl8RAJTwAvEPhEAUKEiwEydFmaEAWqPHwd0ufSb4d8AYsUQQWMrJwjGIli0mTFAei-wAjAB08AAGOsHwaAAWSACuEMDwvAjBbBzcfCzhIsgwSBDQMACe8AC08DFoIDAR0XEJAOZ2POzwUNQ8-K20yNgADrYYAJaoaJ4+8ABMQcEYhb0gSABm8GThUbHxickM2qlcHYLB1gPwxTJOLqke3r4AzNNhNRsJSSGpR+MALNOz80una1qm1ewR2rBaAmCQA
https://github.com/Andarist
Mateusz Burzyński (Andarist)https://github.com/Andarist
on Jan 7, 2023https://github.com/microsoft/TypeScript/issues/45035#issuecomment-1374643817
https://github.com/devanshj
Devansh Jethmalani (devanshj)https://github.com/devanshj
on Jan 7, 2023https://github.com/microsoft/TypeScript/issues/45035#issuecomment-1374653848
herehttps://www.typescriptlang.org/play?jsx=0&ts=4.9.4#code/MYJwpghgLmCyHABYEsB2YAUBvAUAAjwGckwBbCALjyzzADcxUorRIYBlE8gHhqgE8ADmCoAiAGIBRACoBhABKi8AXwB8GAJQqANPjxpkUZBAA2Y5ABMTYUboKEo0MISq4CBS9dd73tJiH4qQkYLbDwBYTEpOUUVDTtfPAB7VG9E92iFMQAzMCgkNABzUR93ZVLlBIJc-JRUQtdygnLlDRwcCzBgEwhwPGAUh37wJ3gC9CpudkcYWgAPGFQLQiIoECLtPEkGJnnF5epwoRFV9fqVdVIKPRpiRDJKQ-pGZi2dqBU8AHovvAB3MD-CC7AAG2xeIPCSTwACNAWhciBwBZkqgTPw8NkQElSHh7uA9JsDEZTFQAHJJACSqERUxmYFUhNWThcpRoAG12PpUHhpk4ALpUH7-QF-YEfEF8mCQqDQuHcxHI1HozHY3H4sClXw0F4BAD8VC1iQAPocIidRHMHE4AHTBJYldLpTbPJjkqk0sAgbjgpiMp2JJqJTYpA1G7V4dmSblvF7s0Tm0T8-kGvAU6m0qUM8NlI1B5p6Vp4AC8qjwdCSlnanW6vUBA1QQ3tFmuBB96ldr0kWlLZuOYit9LtIVstHeVGj5Q6XR6fQbQ1YTk493Ik2k6h7ZekOHNaY9tPXJcj0n57OkexCK2BGL1eAADHgqOgGCB+QBuIA
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoft/TypeScript/issues/45035
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/45035
In DiscussionNot yet reached consensushttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22In%20Discussion%22
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.