Title: JSDoc type reference resolves incorrectly if checked before the constructor function it refers to · Issue #34685 · microsoft/TypeScript · GitHub
Open Graph Title: JSDoc type reference resolves incorrectly if checked before the constructor function it refers to · Issue #34685 · microsoft/TypeScript
X Title: JSDoc type reference resolves incorrectly if checked before the constructor function it refers to · Issue #34685 · microsoft/TypeScript
Description: // @filename: mod1.js var Workspace = {} Workspace.Project = function () { } Workspace.Project.prototype = { isServiceProject() { } } // @filename: test.js /** @param {Workspace.Project} p */ function demo(p) { p.isServiceProject() } Exp...
Open Graph Description: // @filename: mod1.js var Workspace = {} Workspace.Project = function () { } Workspace.Project.prototype = { isServiceProject() { } } // @filename: test.js /** @param {Workspace.Project} p */ funct...
X Description: // @filename: mod1.js var Workspace = {} Workspace.Project = function () { } Workspace.Project.prototype = { isServiceProject() { } } // @filename: test.js /** @param {Workspace.Project} p */ funct...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/34685
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"JSDoc type reference resolves incorrectly if checked before the constructor function it refers to","articleBody":"```js\r\n// @filename: mod1.js\r\nvar Workspace = {}\r\nWorkspace.Project = function () { }\r\nWorkspace.Project.prototype = {\r\n isServiceProject() { }\r\n}\r\n// @filename: test.js\r\n/** @param {Workspace.Project} p */\r\nfunction demo(p) {\r\n p.isServiceProject()\r\n}\r\n```\r\n\r\nExpected: no error, and `p.isServiceProject(): void`.\r\n\r\nActual: no error if you compile `tsc mod1.js test.js`, but an error with `tsc test.js mod1.js`:\r\n\r\nProperty 'isServiceProject' does not exist on type 'typeof Project'.\r\n\r\nFrom chrome-devtools-frontend, failed in https://github.com/microsoft/TypeScript/pull/34603","author":{"url":"https://github.com/sandersn","@type":"Person","name":"sandersn"},"datePublished":"2019-10-23T22:21:07Z","url":"https://github.com/microsoft/TypeScript/issues/34685"}
| 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:f0a0f19b-7fbf-9ce6-67e8-2bfa07c37e8a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D454:14F601:302B577:3D1B55F:6B01ADC8 |
| html-safe-nonce | 9a7ef62f4368c0443bd85f0ef07c0fa5a6391016e92021b909846d454065428b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENDU0OjE0RjYwMTozMDJCNTc3OjNEMUI1NUY6NkIwMUFEQzgiLCJ2aXNpdG9yX2lkIjoiNTIxMjI3Mzc3Mjc4NjIwMDAwOCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 17c64b553921222a6aa3c7513460ffd8b60c6c625ddd4dd03e4946e0226c5e37 |
| hovercard-subject-tag | issue:511602129 |
| 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/34685/issue_layout |
| twitter:image | https://opengraph.githubassets.com/3c58c3a5297efa599f29c370e1ea4de223e65b3f59ee05392960337a3da337a8/microsoft/TypeScript/issues/34685 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/3c58c3a5297efa599f29c370e1ea4de223e65b3f59ee05392960337a3da337a8/microsoft/TypeScript/issues/34685 |
| og:image:alt | // @filename: mod1.js var Workspace = {} Workspace.Project = function () { } Workspace.Project.prototype = { isServiceProject() { } } // @filename: test.js /** @param {Workspace.Project} p */ funct... |
| 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