Title: generic constraint not working · Issue #3720 · microsoft/TypeScript · GitHub
Open Graph Title: generic constraint not working · Issue #3720 · microsoft/TypeScript
X Title: generic constraint not working · Issue #3720 · microsoft/TypeScript
Description: This compiles cleanly: function foo
Open Graph Description: This compiles cleanly: function foo
X Description: This compiles cleanly: function foo <T extends { someNumber: number }> (thingWithId: T): T { return thingWithId; } [1,2].map(foo); and obviously, numbers don't have a someNumber numeric p...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/3720
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"generic constraint not working","articleBody":"This compiles cleanly:\n\n``` typescript\nfunction foo \u003cT extends { someNumber: number }> (thingWithId: T): T {\n return thingWithId;\n}\n\n[1,2].map(foo);\n```\n\nand obviously, numbers don't have a `someNumber` numeric property.\n","author":{"url":"https://github.com/fernandezpablo85","@type":"Person","name":"fernandezpablo85"},"datePublished":"2015-07-02T20:18:25Z","url":"https://github.com/microsoft/TypeScript/issues/3720"}
| 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:fc386ea7-5678-2506-7f00-062c0927f37d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BC16:2DBB21:994CF9:CE1C72:6B00EA4C |
| html-safe-nonce | 95ca25bddda9a6144a2ebe7776ccc95e035893b6554192c0ac54fb1ae9399fe2 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQzE2OjJEQkIyMTo5OTRDRjk6Q0UxQzcyOjZCMDBFQTRDIiwidmlzaXRvcl9pZCI6IjM1NDAzMzc1MTUyMDg2OTg0NDQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 0b1b3dc706fe1845b1faae7501704678558c52f1a2ac40e5012a4b3fed24beb9 |
| hovercard-subject-tag | issue:92725713 |
| 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/3720/issue_layout |
| twitter:image | https://opengraph.githubassets.com/30a79d1d79f5e1ca50f54d673a4e437293eb91a2fdd9ce46ee98378a9fd28500/microsoft/TypeScript/issues/3720 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/30a79d1d79f5e1ca50f54d673a4e437293eb91a2fdd9ce46ee98378a9fd28500/microsoft/TypeScript/issues/3720 |
| og:image:alt | This compiles cleanly: function foo |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | fernandezpablo85 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4ef498cbabcbe3c50befc7a5b743e7072ee770b4daf0e15e54801180d1fa91fc |
| 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 | 9983dd5da06943f833c971dd5b6bc988e2858be5 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width