Title: Version 3.4-dev breaks recursive types · Issue #30188 · microsoft/TypeScript · GitHub
Open Graph Title: Version 3.4-dev breaks recursive types · Issue #30188 · microsoft/TypeScript
X Title: Version 3.4-dev breaks recursive types · Issue #30188 · microsoft/TypeScript
Description: TypeScript Version: 3.4.0-dev.20190302 Search Terms: recursive types I recently published an article about how to create types for curry and ramda. Quite a few people are excited and waiting for me to add these types to DefinitelyTyped. ...
Open Graph Description: TypeScript Version: 3.4.0-dev.20190302 Search Terms: recursive types I recently published an article about how to create types for curry and ramda. Quite a few people are excited and waiting for me...
X Description: TypeScript Version: 3.4.0-dev.20190302 Search Terms: recursive types I recently published an article about how to create types for curry and ramda. Quite a few people are excited and waiting for me...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/30188
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Version 3.4-dev breaks recursive types","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-->\r\n\r\n\u003c!-- Please try to reproduce the issue with `typescript@next`. It may have already been fixed. -->\r\n**TypeScript Version:** 3.4.0-dev.20190302\r\n\r\n\u003c!-- Search terms you tried before logging this (so others can find this issue more easily) -->\r\n**Search Terms:** recursive types\r\n\r\n\r\n\r\nI recently published an article about how to create types for curry and ramda. Quite a few people are excited and waiting for me to add these types to DefinitelyTyped. But I can't pass the `lint` tests yet.\r\n\r\nTo create these (curry) types, I detail how I make use of recursive types. But TS 3.4.0-dev.20190302 is indeed breaking these types. In the latest stable version (3.3.3333) warnings arise (only) when we recurse more than 45 times. A recursive type then returns `any` if the limit is exceeded (which is nice).\r\n\r\nBut in TS 3.4.0-dev.20190302 it appears that \"Type instantiation is excessively deep and possibly infinite\", which is a **breaking** behaviour. But in fact it is only **possibly** infinite, and this is why the previous behaviour should be preferred. `any` could just be returned anytime that limit has been exceeded, thus stopping the recursion condition.\r\n\r\nHowever, recursive types seem to break only when they are nested. Any idea why @ahejlsberg ?\r\n**By breaking this feature, we cannot expect complex types for curry and other tools from ramda.**\r\n\r\n**Code**\r\nArticle: https://medium.freecodecamp.org/typescript-curry-ramda-types-f747e99744ab\r\nRepo : https://github.com/pirix-gh/medium/blob/master/types-curry-ramda/src/index.ts\r\n\r\n**Expected behavior:**\r\nUpdates should not have breaking behaviors\r\n\r\n**Actual behavior:**\r\nBreaking behavior on recursive types\r\n\r\n**Playground Link:** \u003c!-- A link to a TypeScript Playground \"Share\" link which demonstrates this behavior -->\r\n\r\n**Related Issues:** \u003c!-- Did you find other bugs that looked similar? -->\r\nhttps://github.com/Microsoft/TypeScript/issues/29511\r\n","author":{"url":"https://github.com/millsp","@type":"Person","name":"millsp"},"datePublished":"2019-03-02T13:53:43Z","url":"https://github.com/microsoft/TypeScript/issues/30188"}
| 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:640d9995-edb3-017f-a2d9-a9cef41fff9e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C744:38EE04:5474C2:6FB60C:6B019D9E |
| html-safe-nonce | 283b0aa3b0af7dc72d496451ea3b74c80d3cd4caa6b50b0b49030a2e998132db |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNzQ0OjM4RUUwNDo1NDc0QzI6NkZCNjBDOjZCMDE5RDlFIiwidmlzaXRvcl9pZCI6IjYwMDQ3ODAwMzAxNDI1NTM1MDIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | c5699b5f6b6fbe20da3d18b2f491f9643fbff845b3885373975825d4cf3628e7 |
| hovercard-subject-tag | issue:416399563 |
| 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/30188/issue_layout |
| twitter:image | https://opengraph.githubassets.com/cd1c95c81a9884b0f61a819262a55c0d28b0ae390f8b15a884a49e96fb60ecd4/microsoft/TypeScript/issues/30188 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/cd1c95c81a9884b0f61a819262a55c0d28b0ae390f8b15a884a49e96fb60ecd4/microsoft/TypeScript/issues/30188 |
| og:image:alt | TypeScript Version: 3.4.0-dev.20190302 Search Terms: recursive types I recently published an article about how to create types for curry and ramda. Quite a few people are excited and waiting for me... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | millsp |
| 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