Title: Relax the rule on the compiler side that all declarations have the same constraint · Issue #20018 · microsoft/TypeScript · GitHub
Open Graph Title: Relax the rule on the compiler side that all declarations have the same constraint · Issue #20018 · microsoft/TypeScript
X Title: Relax the rule on the compiler side that all declarations have the same constraint · Issue #20018 · microsoft/TypeScript
Description: Originally reported in #14840 Consider WeakSet for instance.. today it is defined as interface WeakSet
Open Graph Description: Originally reported in #14840 Consider WeakSet for instance.. today it is defined as interface WeakSet
X Description: Originally reported in #14840 Consider WeakSet for instance.. today it is defined as interface WeakSet <T> {...}. This is incorrect, as it allows for patterns like const s = new WeakSet<st...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/20018
X: @github
Domain: github.com
IPv4 address: 140.82.112.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Relax the rule on the compiler side that all declarations have the same constraint","articleBody":"Originally reported in https://github.com/Microsoft/TypeScript/issues/14840\r\n\r\nConsider `WeakSet` for instance.. today it is defined as `interface WeakSet \u003cT> {...}`. This is incorrect, as it allows for patterns like `const s = new WeakSet\u003cstring>(); s.add(\"foo\");` which throws at runtime; the correct definition for `WeakSet` is `interface WeakSet\u003cT extends object> { .. }`. \r\n\r\nChanging this definition will cause errors in files that redefine `WeakSet` to add additional members to it.\r\n> Error: All declarations of `WeakSet` must have identical type paramters\r\n\r\nThe proposal here is to allow type parameter declarations to skip constraints. conflicting constraints should still be reported as errors.","author":{"url":"https://github.com/mhegazy","@type":"Person","name":"mhegazy"},"datePublished":"2017-11-14T18:56:02Z","url":"https://github.com/microsoft/TypeScript/issues/20018"}
| 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:ef5ef2e7-6c22-fdba-813f-f000f2a7ae45 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B07C:3AACE0:15F312:1E9C21:6B0465C2 |
| html-safe-nonce | 041f0c4c20d443783aabf8c694c491c5817a0fc4f32270fbf89ea6f62a40f38f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMDdDOjNBQUNFMDoxNUYzMTI6MUU5QzIxOjZCMDQ2NUMyIiwidmlzaXRvcl9pZCI6IjIwNzEyNzk4NTMyNDM3NTM5MjIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 1794fabf81ddf7bb13cb7bfff556e1f9996e894810a190490c9b9afb31387ca6 |
| hovercard-subject-tag | issue:273903922 |
| 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/20018/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b7b50f1fd5f981a466a9b4bc29d5c1cdf78577909fda0b54024815983e4772c7/microsoft/TypeScript/issues/20018 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b7b50f1fd5f981a466a9b4bc29d5c1cdf78577909fda0b54024815983e4772c7/microsoft/TypeScript/issues/20018 |
| og:image:alt | Originally reported in #14840 Consider WeakSet for instance.. today it is defined as interface WeakSet |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mhegazy |
| 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