Title: 5.6 regression: Inference with mixed in type intersection no longer compiles · Issue #59765 · microsoft/TypeScript · GitHub
Open Graph Title: 5.6 regression: Inference with mixed in type intersection no longer compiles · Issue #59765 · microsoft/TypeScript
X Title: 5.6 regression: Inference with mixed in type intersection no longer compiles · Issue #59765 · microsoft/TypeScript
Description: 🔎 Search Terms Inference 🕗 Version & Regression Information This changed between versions 5.5.4 and 5.6.0-beta (still happening in 5.6.1-rc) ⏯ Playground Link https://www.typescriptlang.org/play/?ts=5.6.1-rc#code/C4TwDgpgBAYgrgOwMbAJYHsE...
Open Graph Description: 🔎 Search Terms Inference 🕗 Version & Regression Information This changed between versions 5.5.4 and 5.6.0-beta (still happening in 5.6.1-rc) ⏯ Playground Link https://www.typescriptlang.org/play/?t...
X Description: 🔎 Search Terms Inference 🕗 Version & Regression Information This changed between versions 5.5.4 and 5.6.0-beta (still happening in 5.6.1-rc) ⏯ Playground Link https://www.typescriptlang.org/pla...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/59765
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"5.6 regression: Inference with mixed in type intersection no longer compiles","articleBody":"### 🔎 Search Terms\n\nInference\n\n### 🕗 Version \u0026 Regression Information\n\n- This changed between versions 5.5.4 and 5.6.0-beta (still happening in 5.6.1-rc)\r\n\n\n### ⏯ Playground Link\n\nhttps://www.typescriptlang.org/play/?ts=5.6.1-rc#code/C4TwDgpgBAYgrgOwMbAJYHsEGF0FsyYQLAA8AClALxQCGCIAfFVABRgBO6YAzgFxRkAlFSYBRADYRcRYFAA+UBHHHiA3ACh1qYhHYAzGkmgSpMgILBg7VACM4wCNygBvdVCioAJngDSEEAD8-NxW2gDm8orK4pFKuDa6Gu5IABao4p7sREFQiADWCOgA7ghJUNx5qGA5NujoknQaAL6anhBI4jRZUHqIKBgIUBCS0sTkDCxuUMA0YfzwyGiYOPiEYxQAZFAmo8AWoXYO3AwANFM0ltaHjvyb2yPml7b2jmeC-DsyGuptHV3QvUWA3uADkaNI2JwePxnAhwRAciFrAgwk13vdTMRvsNMcAWBIwdITi40RoAPRkqAAEXQjkU6FkSDwYHS0G0UAArAA6ABsXKgAGUUuhlJ4oEz8KyueogA\n\n### 💻 Code\n\n```ts\r\ntype FunctionComponent\u003cP = any\u003e = (props: P) =\u003e Element | null;\r\n\r\ninterface ElementAttributes {\r\n idomKey?: string | null | number;\r\n children?: unknown;\r\n skip?: boolean;\r\n}\r\n\r\ndeclare function element\u003cP\u003e(\r\n tag: FunctionComponent\u003cP \u0026 ElementAttributes\u003e,\r\n attributes: P \u0026 ElementAttributes,\r\n): Element;\r\n\r\ndeclare function ElName(props: {name?: string}): Element;\r\n\r\nelement(ElName, {});\r\n// Does not compile in 5.6. Should compile.\r\n```\r\n\n\n### 🙁 Actual behavior\n\nLast line errors with:\r\n\r\n```\r\nArgument of type '(props: { name?: string | undefined; }) =\u003e Element' is not assignable to parameter of type 'FunctionComponent\u003cElementAttributes\u003e'.\r\n Types of parameters 'props' and 'props' are incompatible.\r\n Type 'ElementAttributes' has no properties in common with type '{ name?: string | undefined; }'.(2345)\r\n```\n\n### 🙂 Expected behavior\n\nCompiles as it did in previous versions\n\n### Additional information about the issue\n\nConfirmed that https://github.com/microsoft/TypeScript/pull/59709 does not resolve this issue.\r\n\r\n(Google note: relevant source location http://shortn/_Ce1E5yV592)","author":{"url":"https://github.com/trevorade","@type":"Person","name":"trevorade"},"datePublished":"2024-08-26T21:44:56.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/59765/TypeScript/issues/59765"}
| 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:e6005ee4-6f4e-a82d-bf22-d75dd93e6c1f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D5E2:DED1E:365CEC:48AF30:6A614E2A |
| html-safe-nonce | 925e3714ab38099b07629d5a62eab488150d18325d16c267d0d9e9d150a5f34d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENUUyOkRFRDFFOjM2NUNFQzo0OEFGMzA6NkE2MTRFMkEiLCJ2aXNpdG9yX2lkIjoiNzc2NDA2ODM5NDAzMDIzNzgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 6d7ecabaab8a558842b3af2f8c69ee1ed3da68b1a399143a3db2b49298112bb0 |
| hovercard-subject-tag | issue:2487840144 |
| 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/59765/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ccc38fc80d35fd0617f516941d2854efb52466602dc54193ff328bbfbd4e7fcb/microsoft/TypeScript/issues/59765 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ccc38fc80d35fd0617f516941d2854efb52466602dc54193ff328bbfbd4e7fcb/microsoft/TypeScript/issues/59765 |
| og:image:alt | 🔎 Search Terms Inference 🕗 Version & Regression Information This changed between versions 5.5.4 and 5.6.0-beta (still happening in 5.6.1-rc) ⏯ Playground Link https://www.typescriptlang.org/play/?t... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | trevorade |
| hostname | github.com |
| expected-hostname | github.com |
| None | 35b919fdb8e6752d2ed95a144e761ca5e924557563e2ed0a5ebf6c4430cdeeb6 |
| 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 | 1e22b08b60ccb67c3791f565bed248565260e611 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width