Title: JSDOC @type tag crashes with simple export · Issue #36830 · microsoft/TypeScript · GitHub
Open Graph Title: JSDOC @type tag crashes with simple export · Issue #36830 · microsoft/TypeScript
X Title: JSDOC @type tag crashes with simple export · Issue #36830 · microsoft/TypeScript
Description: TypeScript Version: 3.9.0-dev.20200215 (also tested 3.7.5) (the last one that doesn't crash is v3.7.1-rc. v3.7.2 crashes) Search Terms: Maximum call stack size exceeded getTypeOfFuncClassEnumModule Code /lib/index.js: /** @type {import('...
Open Graph Description: TypeScript Version: 3.9.0-dev.20200215 (also tested 3.7.5) (the last one that doesn't crash is v3.7.1-rc. v3.7.2 crashes) Search Terms: Maximum call stack size exceeded getTypeOfFuncClassEnumModule...
X Description: TypeScript Version: 3.9.0-dev.20200215 (also tested 3.7.5) (the last one that doesn't crash is v3.7.1-rc. v3.7.2 crashes) Search Terms: Maximum call stack size exceeded getTypeOfFuncClassEnumMo...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/36830
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"JSDOC @type tag crashes with simple export","articleBody":"\u003c!--\r\nPlease try to reproduce the issue with the latest published version. It may have already been fixed.\r\nFor npm: `typescript@next`\r\nThis is also the 'Nightly' version in the playground: http://www.typescriptlang.org/play/?ts=Nightly\r\n-->\r\n**TypeScript Version:** 3.9.0-dev.20200215 (also tested 3.7.5)\r\n\r\n(the last one that doesn't crash is `v3.7.1-rc`. `v3.7.2` crashes)\r\n\r\n\u003c!-- Search terms you tried before logging this (so others can find this issue more easily) -->\r\n**Search Terms:**\r\n\r\n`Maximum call stack size exceeded`\r\n`getTypeOfFuncClassEnumModule`\r\n\r\n**Code**\r\n\r\n`/lib/index.js`:\r\n```js\r\n/** @type {import('../types/index').xxx} */\r\nfunction xxx() {\r\n return null;\r\n}\r\n```\r\n\r\n`/types/index.d.ts`:\r\n```ts\r\nexport function xxx(): string;\r\n```\r\n\r\n`/tsconfig.json`:\r\n```js\r\n{\r\n \"compilerOptions\": {\r\n \"target\": \"esnext\",\r\n \"module\": \"commonjs\",\r\n \"esModuleInterop\": true,\r\n \"lib\": [\r\n \"dom\",\r\n \"esnext\"\r\n ],\r\n \"allowJs\": true,\r\n \"checkJs\": true,\r\n \"noEmit\": true,\r\n \"resolveJsonModule\": true,\r\n \"strict\": true,\r\n \"moduleResolution\": \"node\",\r\n \"baseUrl\": \".\",\r\n }\r\n}\r\n```\r\n\r\n**Expected behavior:**\r\n\r\nNo crash.\r\nTypescript error about function returning wrong error type.\r\n\r\n**Actual behavior:**\r\n\r\nCrash.\r\n\r\n```\r\n/me/ts-crash-test/node_modules/typescript/lib/tsc.js:81193\r\n throw e;\r\n ^\r\n\r\nRangeError: Maximum call stack size exceeded\r\n at getSymbolLinks (/me/ts-crash-test/node_modules/typescript/lib/tsc.js:28829:32)\r\n at getTypeOfFuncClassEnumModule (/me/ts-crash-test/node_modules/typescript/lib/tsc.js:33936:25)\r\n at getTypeOfSymbol (/me/ts-crash-test/node_modules/typescript/lib/tsc.js:34045:24)\r\n at getTypeFromJSDocValueReference (/me/ts-crash-test/node_modules/typescript/lib/tsc.js:36634:33)\r\n at getTypeReferenceType (/me/ts-crash-test/node_modules/typescript/lib/tsc.js:36620:33)\r\n at getTypeFromJSDocValueReference (/me/ts-crash-test/node_modules/typescript/lib/tsc.js:36648:36)\r\n at getTypeReferenceType (/me/ts-crash-test/node_modules/typescript/lib/tsc.js:36620:33)\r\n at getTypeFromJSDocValueReference (/me/ts-crash-test/node_modules/typescript/lib/tsc.js:36648:36)\r\n at getTypeReferenceType (/me/ts-crash-test/node_modules/typescript/lib/tsc.js:36620:33)\r\n at getTypeFromJSDocValueReference (/me/ts-crash-test/node_modules/typescript/lib/tsc.js:36648:36)\r\n```\r\n\r\n**Playground Link:** \u003c!-- A link to a TypeScript Playground \"Share\" link which demonstrates this behavior -->\r\n\r\nhttps://github.com/rchl/ts-crash-test\r\n\r\n**Related Issues:** \u003c!-- Did you find other bugs that looked similar? -->\r\n","author":{"url":"https://github.com/rchl","@type":"Person","name":"rchl"},"datePublished":"2020-02-17T12:17:43Z","url":"https://github.com/microsoft/TypeScript/issues/36830"}
| 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:9b692fd3-c287-5186-e5fe-c3e650b07f8a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DDCE:16AB79:28DAA0E:33F2C89:6B01A20C |
| html-safe-nonce | c4cc3354774212c075bb73a7e2e987fb63c4f25271f0acfb04e8162cee842d1d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERENFOjE2QUI3OToyOERBQTBFOjMzRjJDODk6NkIwMUEyMEMiLCJ2aXNpdG9yX2lkIjoiNTA0OTY3MjIxNjUzOTY2OTAwNCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 2b3bba5e706a2f129a9dca99a09a487aaf6f9a15cfb6ec64a5ce160d93845c57 |
| hovercard-subject-tag | issue:566261777 |
| 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/36830/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a2b34f7d90c7d9dbce9685cde108fb670ccde9222a490d9dd778afd89e81843e/microsoft/TypeScript/issues/36830 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a2b34f7d90c7d9dbce9685cde108fb670ccde9222a490d9dd778afd89e81843e/microsoft/TypeScript/issues/36830 |
| og:image:alt | TypeScript Version: 3.9.0-dev.20200215 (also tested 3.7.5) (the last one that doesn't crash is v3.7.1-rc. v3.7.2 crashes) Search Terms: Maximum call stack size exceeded getTypeOfFuncClassEnumModule... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | rchl |
| 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