Title: Nightly bug(?) with infering function generic while being part of intersection · Issue #49307 · microsoft/TypeScript · GitHub
Open Graph Title: Nightly bug(?) with infering function generic while being part of intersection · Issue #49307 · microsoft/TypeScript
X Title: Nightly bug(?) with infering function generic while being part of intersection · Issue #49307 · microsoft/TypeScript
Description: First of all, the title exists for the sake of a title. I don't really know exactly what is wrong with this bug. I came across this while working on something with redux tookit. Error: Parameter 'state' implicitly has an 'any' type. Expe...
Open Graph Description: First of all, the title exists for the sake of a title. I don't really know exactly what is wrong with this bug. I came across this while working on something with redux tookit. Error: Parameter 's...
X Description: First of all, the title exists for the sake of a title. I don't really know exactly what is wrong with this bug. I came across this while working on something with redux tookit. Error: Paramete...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/49307
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Nightly bug(?) with infering function generic while being part of intersection","articleBody":"First of all, the title exists for the sake of a title. I don't really know exactly what is wrong with this bug. I came across this while working on something with redux tookit.\r\n\u003cimg width=\"300\" alt=\"Screen Shot 2022-05-30 at 2 15 00 AM\" src=\"https://user-images.githubusercontent.com/67543533/170959557-9742be58-a1de-4ccb-95ca-5f7db9582a64.png\">\r\n**Error**: `Parameter 'state' implicitly has an 'any' type.`\r\n**Expected**: `state = WritableDraft\u003c{username: string, isLoggedIn: true, ...}>`\r\n\r\nI am using the nightly extension and the bug has not occured because of an update to redux toolkit or a change in my code, but has instead been because of typescript versions changing.\r\nThe code itself works in [typescript 4.7.0](https://www.typescriptlang.org/play?ts=4.7.0-beta#code/JYWwDg9gTgLgBAbzgYygUwIYzQZQDbDJoA0cAwulrgUQPJgzAQB2AzqQAoYCeeEGAEwCCyRi1L5CaMhlZoASmgEBXIlFZwAvnABmUCCDgAiAALoVADwBWrAPQwIEPAGtgMIwG4AsAChfaC0hYFBZWeGQCNGYYSSI4AF4USmxYtAAKBF8ASGYMEDQALmMySOijYmzgZjdgDDwcGCoizJ8srOU5KFz8oqNy7KzgVgAZCABzMaUASWYinTq5Ctb2zqmBXv7ljAA3LAwoDaWszSPzVTR1ZoGWEuAomABVTrIACwxmSYE0sKpSDFEmLM4FxePxhACWABKFptLK2WxwAB0yIGmmyaJ8mkhHiAA) but not in [typescript nightly/4.8.0](https://www.typescriptlang.org/play?ts=4.8.0-dev.20220530#code/JYWwDg9gTgLgBAbzgYygUwIYzQZQDbDJoA0cAwulrgUQPJgzAQB2AzqQAoYCeeEGAEwCCyRi1L5CaMhlZoASmgEBXIlFZwAvnABmUCCDgAiAALoVADwBWrAPQwIEPAGtgMIwG4AsAChfaC0hYFBZWeGQCNGYYSSI4AF4USmxYtAAKBF8ASGYMEDQALmMySOijYmzgZjdgDDwcGCoizJ8srOU5KFz8oqNy7KzgVgAZCABzMaUASWYinTq5Ctb2zqmBXv7ljAA3LAwoDaWszSPzVTR1ZoGWEuAomABVTrIACwxmSYE0sKpSDFEmLM4FxePxhACWABKFptLK2WxwAB0yIGmmyaJ8mkhHiAA)\r\n\r\nIn order to create a minimum reproducible example, I have tried to simplify it as much as possible, (which was harder than I imagined). The problem is rather weird, there are multiple parts that cause this bug and removing any will fix it. However, the issue remains, [version 4.7.0](https://www.typescriptlang.org/play?ts=4.7.0-beta#code/KYDwDg9gTgLgBAE2AYwDYEMrDgMwK4B2yMAlhAXMlujMAMqonLAA8AwugM7ABKwCeZlE4A+ABQBYAFBxZcLAKGcAXHADe0gJCaA2gGlVnGFBIEA5gF1VYozWCq1AXwCUAXhEA3CCQRbHcADJ1LV0AFThTOABrYABPCBw4Dm4+RWBhK3VHP2lnVS8fAG5paSpgOwYmYEkpTQ1azXQxdGcsnKlnIA) works while the same on [nightly](https://www.typescriptlang.org/play?ts=4.8.0-dev.20220530#code/KYDwDg9gTgLgBAE2AYwDYEMrDgMwK4B2yMAlhAXMlujMAMqonLAA8AwugM7ABKwCeZlE4A+ABQBYAFBxZcLAKGcAXHADe0gJCaA2gGlVnGFBIEA5gF1VYozWCq1AXwCUAXhEA3CCQRbHcADJ1LV0AFThTOABrYABPCBw4Dm4+RWBhK3VHP2lnVS8fAG5paSpgOwYmYEkpTQ1azXQxdGcsnKlnIA) errors.\r\n\r\nAt this point, I still do not know exactly what the problem is. In fact, it may even be intentional. However, this is something that breaks redux toolkit so I think the matter is something worth taking a look at.\r\n\r\nWhat search terms have I used? None. I don't know how to put this bug into words.","author":{"url":"https://github.com/toodols","@type":"Person","name":"toodols"},"datePublished":"2022-05-30T09:29:30Z","url":"https://github.com/microsoft/TypeScript/issues/49307"}
| 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:8fd45748-8520-3ac8-e1dd-ce5e24f6897b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A862:1201C:20947C0:2B3EB34:6B01799F |
| html-safe-nonce | 6ae7a8f9cf42c3da42efa34f8dac6aa9b8a9c8cc327b3dc86b4dc100146140d7 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBODYyOjEyMDFDOjIwOTQ3QzA6MkIzRUIzNDo2QjAxNzk5RiIsInZpc2l0b3JfaWQiOiI1NjQ4NzI4MTg2MTk2OTQ5NDA3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 65ae31cfe7d98b6acbb4040930eb6a94884e663eb2099326be5aca7baaad1990 |
| hovercard-subject-tag | issue:1252456519 |
| 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/49307/issue_layout |
| twitter:image | https://opengraph.githubassets.com/567375dafe8b52c1109922382c66d5106690b1e45a9e06606542e0f103c47961/microsoft/TypeScript/issues/49307 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/567375dafe8b52c1109922382c66d5106690b1e45a9e06606542e0f103c47961/microsoft/TypeScript/issues/49307 |
| og:image:alt | First of all, the title exists for the sake of a title. I don't really know exactly what is wrong with this bug. I came across this while working on something with redux tookit. Error: Parameter 's... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | toodols |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| 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 | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width