Title: Incorrect overload resolution in 3.2.0-rc · Issue #28567 · microsoft/TypeScript · GitHub
Open Graph Title: Incorrect overload resolution in 3.2.0-rc · Issue #28567 · microsoft/TypeScript
X Title: Incorrect overload resolution in 3.2.0-rc · Issue #28567 · microsoft/TypeScript
Description: TypeScript Version: 3.2.0-rc Search Terms: Overload Code import { createStore } from 'redux' const initialStore: { foo: {} } = { foo: {} } const store = createStore(x => x, initialStore) Expected behavior: The second overload of createSt...
Open Graph Description: TypeScript Version: 3.2.0-rc Search Terms: Overload Code import { createStore } from 'redux' const initialStore: { foo: {} } = { foo: {} } const store = createStore(x => x, initialStore) Expected b...
X Description: TypeScript Version: 3.2.0-rc Search Terms: Overload Code import { createStore } from 'redux' const initialStore: { foo: {} } = { foo: {} } const store = createStore(x => x, initialStore)...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/28567
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Incorrect overload resolution in 3.2.0-rc","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--\u003e\r\n\r\n\u003c!-- Please try to reproduce the issue with `typescript@next`. It may have already been fixed. --\u003e\r\n**TypeScript Version:** 3.2.0-rc\r\n\r\n\u003c!-- Search terms you tried before logging this (so others can find this issue more easily) --\u003e\r\n**Search Terms:**\r\nOverload\r\n\r\n**Code**\r\n\r\n```ts\r\nimport { createStore } from 'redux'\r\n\r\nconst initialStore: { foo: {} } = { foo: {} }\r\nconst store = createStore(x =\u003e x, initialStore)\r\n```\r\n\r\n**Expected behavior:**\r\n\r\nThe second overload of `createStore` should be chosen, as `initialStore` is not a `StoreEnhancer` but a `preloadedState`.\r\n\r\n**Actual behavior:**\r\n\r\nThe `StoreEnhancer`, a function, overload of `createStore` is chosen despite `initialStore` being absolutely, definitely not a function, causing the type of `x` to be incorrectly inferred as `{} | undefined`.\r\n","author":{"url":"https://github.com/Jessidhia","@type":"Person","name":"Jessidhia"},"datePublished":"2018-11-16T02:38:57.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/28567/TypeScript/issues/28567"}
| 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:45167059-ba1e-a50f-16d0-6eb205776993 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EBEE:18E395:266412:368C44:6A621D71 |
| html-safe-nonce | 26211abd3cfd65ec0e263cc44df5b94a845f49eeb2497521cc4b16a28f3e71a0 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQkVFOjE4RTM5NToyNjY0MTI6MzY4QzQ0OjZBNjIxRDcxIiwidmlzaXRvcl9pZCI6IjU3NjEyNTI1MjgyOTU2NDg2MjUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 5501b9a386e11e6ef138b6a9a53da7f0c153e8a8375699a92331cf8ea143be2e |
| hovercard-subject-tag | issue:381422189 |
| 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/28567/issue_layout |
| twitter:image | https://opengraph.githubassets.com/46ad10eac11221f58ff491fd12066ddbdc4e2fa3799e035226e0591e33bb97ce/microsoft/TypeScript/issues/28567 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/46ad10eac11221f58ff491fd12066ddbdc4e2fa3799e035226e0591e33bb97ce/microsoft/TypeScript/issues/28567 |
| og:image:alt | TypeScript Version: 3.2.0-rc Search Terms: Overload Code import { createStore } from 'redux' const initialStore: { foo: {} } = { foo: {} } const store = createStore(x => x, initialStore) Expected b... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Jessidhia |
| hostname | github.com |
| expected-hostname | github.com |
| None | be68eaf9abf2a202afbd94047d7200fb88b7edb0338f533bf171bbb1a69fab4e |
| 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 | 3d00b04c8874615454dfbdb32a7d2ca4db66d3f4 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width