Title: Circular typedef references causes incorrect error · Issue #34809 · microsoft/TypeScript · GitHub
Open Graph Title: Circular typedef references causes incorrect error · Issue #34809 · microsoft/TypeScript
X Title: Circular typedef references causes incorrect error · Issue #34809 · microsoft/TypeScript
Description: // @filename: test.js const mod1 = require('./mod1') /** @typedef {number} CompilerStatus */ /** @type {CompilerStatus[]} */ var compilerStatus; mod1; module.exports = class C { } // @filename: mod1.js /** @type {import("./test")} */ var...
Open Graph Description: // @filename: test.js const mod1 = require('./mod1') /** @typedef {number} CompilerStatus */ /** @type {CompilerStatus[]} */ var compilerStatus; mod1; module.exports = class C { } // @filename: mod...
X Description: // @filename: test.js const mod1 = require('./mod1') /** @typedef {number} CompilerStatus */ /** @type {CompilerStatus[]} */ var compilerStatus; mod1; module.exports = class C { } // @filen...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/34809
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Circular typedef references causes incorrect error","articleBody":"```js\r\n// @filename: test.js\r\nconst mod1 = require('./mod1')\r\n/** @typedef {number} CompilerStatus */\r\n/** @type {CompilerStatus[]} */\r\nvar compilerStatus;\r\nmod1;\r\nmodule.exports = class C {\r\n}\r\n\r\n// @filename: mod1.js\r\n/** @type {import(\"./test\")} */\r\nvar megaman;\r\nmodule.exports = megaman\r\n```\r\n\r\nExpected: No error, or maybe a circular reference error somewhere.\r\n\r\nActual: Error on `@typedef {number} CompilerStatus`: \"Duplicate identifier 'CompilerStatus'.\".\r\n\r\nBonus: in test.js, if you export `module.exports = {}` you get a stack overflow from the language service. I couldn't get this from the compiler, but I didn't try too hard.","author":{"url":"https://github.com/sandersn","@type":"Person","name":"sandersn"},"datePublished":"2019-10-29T20:44:00Z","url":"https://github.com/microsoft/TypeScript/issues/34809"}
| 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:4546d8cf-9226-2bcd-a844-f9922721a9dc |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BC10:11EACE:2D6C738:3CB187D:6B01D2D3 |
| html-safe-nonce | 8872e8f5f8f3382ccd131983289055543e3868155cf0e563a706c0f457fcfa16 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQzEwOjExRUFDRToyRDZDNzM4OjNDQjE4N0Q6NkIwMUQyRDMiLCJ2aXNpdG9yX2lkIjoiNTQ3NTI2OTQwNzg5MjY4OTYxOSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 012478e91df12fb0e58b94adb9a1f2244277cacc50477aa87f427c57579b039f |
| hovercard-subject-tag | issue:514211455 |
| 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/34809/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2a5d9eac2d18a6e8e7dbf60a290f986c20636fb5796afe79e58cdecee9abc4f5/microsoft/TypeScript/issues/34809 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2a5d9eac2d18a6e8e7dbf60a290f986c20636fb5796afe79e58cdecee9abc4f5/microsoft/TypeScript/issues/34809 |
| og:image:alt | // @filename: test.js const mod1 = require('./mod1') /** @typedef {number} CompilerStatus */ /** @type {CompilerStatus[]} */ var compilerStatus; mod1; module.exports = class C { } // @filename: mod... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | sandersn |
| 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