Title: Takes a while with high memory to calculate highly recursive types with intersections · Issue #20558 · microsoft/TypeScript · GitHub
Open Graph Title: Takes a while with high memory to calculate highly recursive types with intersections · Issue #20558 · microsoft/TypeScript
X Title: Takes a while with high memory to calculate highly recursive types with intersections · Issue #20558 · microsoft/TypeScript
Description: TypeScript Version: 2.6.2 Code Apologies for the length - I can't really make the repro any smaller than this without it taking a fraction of the time and about half the memory. Also, note: this does not require a config. interface Conte...
Open Graph Description: TypeScript Version: 2.6.2 Code Apologies for the length - I can't really make the repro any smaller than this without it taking a fraction of the time and about half the memory. Also, note: this do...
X Description: TypeScript Version: 2.6.2 Code Apologies for the length - I can't really make the repro any smaller than this without it taking a fraction of the time and about half the memory. Also, note: thi...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/20558
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Takes a while with high memory to calculate highly recursive types with intersections","articleBody":"\u003c!-- BUGS: Please use this template. -->\r\n\u003c!-- QUESTIONS: This is not a general support forum! Ask Qs at http://stackoverflow.com/questions/tagged/typescript -->\r\n\u003c!-- SUGGESTIONS: See https://github.com/Microsoft/TypeScript-wiki/blob/master/Writing-Good-Design-Proposals.md -->\r\n\r\n\u003c!-- Please try to reproduce the issue with `typescript@next`. It may have already been fixed. -->\r\n**TypeScript Version:** 2.6.2\r\n\r\n**Code**\r\n\r\nApologies for the length - I can't really make the repro any smaller than this without it taking a fraction of the time and about half the memory. Also, note: this does not require a config.\r\n\r\n```ts\r\ninterface Context\u003cP, O> {\r\n createV(this: this & Context\u003cP, O & {raw: true}>, attrs: P): Context\u003cP, O>;\r\n createRC(this: this & Context\u003cP, O & {raw: true}>, attrs: P, ref: (elem: P) => any): Context\u003cP, O>;\r\n\r\n simpleV(this: this & Context\u003cP, O & {raw: true}>, attrs: P): void;\r\n simpleRC(this: this & Context\u003cP, O & {raw: true}>, attrs: P, ref: (elem: P) => any): void;\r\n\r\n add(this: this & Context\u003cP, O & {text: true}>): void;\r\n raw(this: this & Context\u003cP, O & {raw: true}>, elem: P): void;\r\n\r\n invokeC\u003cC>(\r\n tag: Component\u003cobject, P, O>,\r\n children: (r: Context\u003cP, O>, context: C) => void,\r\n context: C\r\n ): void;\r\n invokeAC\u003cA extends object, C>(\r\n tag: Component\u003cA, P, O>, attrs: A,\r\n children: (r: Context\u003cP, O>, context: C) => void,\r\n context: C\r\n ): void;\r\n}\r\n\r\ninterface TopContext\u003cP, O> extends Context\u003cP, O> {\r\n hasOption\u003cK extends keyof O>(key: K): this is (this & TopContext\u003cP, {[P in K]: O[P]}>);\r\n}\r\n\r\ntype Component\u003cA extends object, P, O> = \u003cC>(\r\n attrs: A, r: TopContext\u003cP, O>,\r\n children: (r: Context\u003cP, O>, context: C) => void,\r\n context: C\r\n) => void\r\n\r\ninterface ContextWrap\u003cP, O> {\r\n instance: Context\u003cP, O>;\r\n}\r\n\r\ninterface TopContextWrap\u003cP, O> extends ContextWrap\u003cP, O> {\r\n instance: TopContext\u003cP, O>;\r\n}\r\n```\r\n\r\n**Expected behavior:** It to take maybe a few seconds. Remove any one function or property out of that, and that's the compilation time I would normally expect.\r\n\r\n**Actual behavior:** It takes ~15-20 seconds to check, and requires ~180-200 MB of memory in the process.\r\n","author":{"url":"https://github.com/dead-claudia","@type":"Person","name":"dead-claudia"},"datePublished":"2017-12-08T00:16:38Z","url":"https://github.com/microsoft/TypeScript/issues/20558"}
| 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:22b52edf-3f81-1857-9dcc-a38f2d3a087f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9C26:23CF06:2A15D37:359A10C:6B019757 |
| html-safe-nonce | 15742c3d78e38066ed2cd3eea0cf30038de697e51282e75a85a627817489803b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QzI2OjIzQ0YwNjoyQTE1RDM3OjM1OUExMEM6NkIwMTk3NTciLCJ2aXNpdG9yX2lkIjoiMjA0MjE1NTMyNzgyMjA3NTczNSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | bdf714e599399568510aa2f75295e0070aa55a46b9d7ec97c133c2932d184fcd |
| hovercard-subject-tag | issue:280325856 |
| 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/20558/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f6a2f3481895f81954f2141625ce892ba5580f746bd969a9596f44b4eb60f0ba/microsoft/TypeScript/issues/20558 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f6a2f3481895f81954f2141625ce892ba5580f746bd969a9596f44b4eb60f0ba/microsoft/TypeScript/issues/20558 |
| og:image:alt | TypeScript Version: 2.6.2 Code Apologies for the length - I can't really make the repro any smaller than this without it taking a fraction of the time and about half the memory. Also, note: this do... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dead-claudia |
| 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