Title: Allow `super` constrains for type parameters · Issue #7265 · microsoft/TypeScript · GitHub
Open Graph Title: Allow `super` constrains for type parameters · Issue #7265 · microsoft/TypeScript
X Title: Allow `super` constrains for type parameters · Issue #7265 · microsoft/TypeScript
Description: I'd like to be able to express constraints in a generic function the opposite direction as extends. For example, I'd like to write something like: class Foo { bar: number; } function send
Open Graph Description: I'd like to be able to express constraints in a generic function the opposite direction as extends. For example, I'd like to write something like: class Foo { bar: number; } function send X Description: I'd like to be able to express constraints in a generic function the opposite direction as extends. For example, I'd like to write something like: class Foo { bar: number; } function send&l...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/7265
X: @github
Domain: github.com
Links:
Viewport: width=device-width
Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Allow `super` constrains for type parameters","articleBody":"I'd like to be able to express constraints in a generic function the opposite direction as `extends`. For example, I'd like to write something like:\n\n```\nclass Foo {\n bar: number;\n}\nfunction send\u003cT, Foo extends T>(overrides: T) {\n}\nsend({ bar: \"hello\" }); // this should be a compile error\n```\n\nThat is, T cannot have any fields not in Foo.\n","author":{"url":"https://github.com/chadaustin","@type":"Person","name":"chadaustin"},"datePublished":"2016-02-26T22:24:08Z","url":"https://github.com/microsoft/TypeScript/issues/7265"}
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:1d3c2fa0-26dd-8fe2-c98f-6a1ec5797c9d current-catalog-service-hash 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 request-id 843A:2564D8:399D99:4E3B77:6B00C6E9 html-safe-nonce 034565d42de083027c2daccb827712a667d406a47727c80e4a1f37ec55240329 visitor-payload eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NDNBOjI1NjREODozOTlEOTk6NEUzQjc3OjZCMDBDNkU5IiwidmlzaXRvcl9pZCI6Ijc3OTgzMTQ2NTg3NzQ5NTk4NDkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== visitor-hmac 89225d3a728733312f008269d3ce6be175ddbf80f4cb8676156e85c88258590f hovercard-subject-tag issue:136831532 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/7265/issue_layout twitter:image https://opengraph.githubassets.com/ddcca4085f7f9a21bc31f49e41437d402efb9ddfa377845589f71f4277a37306/microsoft/TypeScript/issues/7265 twitter:card summary_large_image og:image https://opengraph.githubassets.com/ddcca4085f7f9a21bc31f49e41437d402efb9ddfa377845589f71f4277a37306/microsoft/TypeScript/issues/7265 og:image:alt I'd like to be able to express constraints in a generic function the opposite direction as extends. For example, I'd like to write something like: class Foo { bar: number; } function send og:image:width 1200 og:image:height 600 og:site_name GitHub og:type object og:author:username chadaustin hostname github.com expected-hostname github.com None 98dc00e171c204462a6f367482a0f8c3c6b5dbca99cd7390e82d2df49ce096e4 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 ef013399cf0a3c324bea644a685d7c1e0f06b5b7 ui-target full theme-color #1e2327 color-scheme light dark react-app-name issues
URLs of crawlers that visited me.