Title: Prototype assignment of constructor nested inside a class confuses type resolution · Issue #26496 · microsoft/TypeScript · GitHub
Open Graph Title: Prototype assignment of constructor nested inside a class confuses type resolution · Issue #26496 · microsoft/TypeScript
X Title: Prototype assignment of constructor nested inside a class confuses type resolution · Issue #26496 · microsoft/TypeScript
Description: From chrome-devtools-frontend, in ui/ListWidget.js: var UI = {} UI.ListWidget = class { }; UI.ListWidget.Delegate = function() {}; UI.ListWidget.Delegate.prototype = { renderItem() {}, }; /** @type {UI.ListWidget} */ var l = new UI.ListW...
Open Graph Description: From chrome-devtools-frontend, in ui/ListWidget.js: var UI = {} UI.ListWidget = class { }; UI.ListWidget.Delegate = function() {}; UI.ListWidget.Delegate.prototype = { renderItem() {}, }; /** @type...
X Description: From chrome-devtools-frontend, in ui/ListWidget.js: var UI = {} UI.ListWidget = class { }; UI.ListWidget.Delegate = function() {}; UI.ListWidget.Delegate.prototype = { renderItem() {}, }; /** @type...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/26496
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Prototype assignment of constructor nested inside a class confuses type resolution","articleBody":"From chrome-devtools-frontend, in ui/ListWidget.js:\r\n\r\n```js\r\nvar UI = {}\r\nUI.ListWidget = class { };\r\n\r\nUI.ListWidget.Delegate = function() {};\r\nUI.ListWidget.Delegate.prototype = {\r\n renderItem() {},\r\n};\r\n\r\n/** @type {UI.ListWidget} */\r\nvar l = new UI.ListWidget();\r\n```\r\n\r\n**Expected behavior:**\r\n\r\nThe type of `l` is the same as `new UI.ListWidget()` — `UI.ListWidget`.\r\n\r\n**Actual behavior:**\r\nIt's `{ renderItem() {} } & { renderItem() {} }` -- the structural type of UI.ListWidget.Delegate, duplicated. This also causes an assignability error from `new UI.ListWidget()`.\r\n\r\nNote that this has been broken for some time; it's not a 3.1 regression.","author":{"url":"https://github.com/sandersn","@type":"Person","name":"sandersn"},"datePublished":"2018-08-16T17:47:37Z","url":"https://github.com/microsoft/TypeScript/issues/26496"}
| 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:eaa851fc-4cd5-1393-7e4e-33ed2257de7c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 94B0:245336:2F4FFF:40FF5F:6B046AE8 |
| html-safe-nonce | 1294041720e22ebb99dc6dafe17ffaa48d208ce567c98c008cb76c352284ca99 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NEIwOjI0NTMzNjoyRjRGRkY6NDBGRjVGOjZCMDQ2QUU4IiwidmlzaXRvcl9pZCI6IjQ3Mzk0ODc4ODc0MjEzNjkwNjQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 479758d5fefee312ed3972bb39107cca012fdf557fead050d8aec0762971a1eb |
| hovercard-subject-tag | issue:351304898 |
| 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/26496/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a95bd7746c8ca27a8709ba30ce6998b53c88a6de3f3369fe84d9695156df4da7/microsoft/TypeScript/issues/26496 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a95bd7746c8ca27a8709ba30ce6998b53c88a6de3f3369fe84d9695156df4da7/microsoft/TypeScript/issues/26496 |
| og:image:alt | From chrome-devtools-frontend, in ui/ListWidget.js: var UI = {} UI.ListWidget = class { }; UI.ListWidget.Delegate = function() {}; UI.ListWidget.Delegate.prototype = { renderItem() {}, }; /** @type... |
| 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 | 83e4c0e58c5162177f3c161c5fbad38527ae04c11ac14980f9f9d85ae2027b1f |
| 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 | ca4d07a7cef4e4b75f821dc25e7300d80c1450a9 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width