Title: Overload resolution produces an incorrect error when type arguments don't satisfy the first overload · Issue #807 · microsoft/TypeScript · GitHub
Open Graph Title: Overload resolution produces an incorrect error when type arguments don't satisfy the first overload · Issue #807 · microsoft/TypeScript
X Title: Overload resolution produces an incorrect error when type arguments don't satisfy the first overload · Issue #807 · microsoft/TypeScript
Description: declare function f
Open Graph Description: declare function f
X Description: declare function f<T extends Number>(x: T): T; declare function f<T extends String>(x: T): T var v = f<string>(""); Expected: The second overload gets picked and there i...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/807
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Overload resolution produces an incorrect error when type arguments don't satisfy the first overload","articleBody":"``` TS\ndeclare function f\u003cT extends Number>(x: T): T;\ndeclare function f\u003cT extends String>(x: T): T\n\nvar v = f\u003cstring>(\"\");\n```\n\nExpected: The second overload gets picked and there is no error.\nActual: An error:\nerror TS2343: Type 'string' does not satisfy the constraint 'Number':\n Property 'toFixed' is missing in type 'String'.\n","author":{"url":"https://github.com/JsonFreeman","@type":"Person","name":"JsonFreeman"},"datePublished":"2014-10-02T21:54:20Z","url":"https://github.com/microsoft/TypeScript/issues/807"}
| 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:24138ed4-ede0-ffe3-a931-f1a960681366 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C50C:350283:5B7A68:7A2DC0:6B0091AB |
| html-safe-nonce | db67ee9a982b5b3b9d4538ac5266c170ea6a2de06ff4f10b6a7cef42babbe868 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNTBDOjM1MDI4Mzo1QjdBNjg6N0EyREMwOjZCMDA5MUFCIiwidmlzaXRvcl9pZCI6IjkwMjM4ODg0OTg3MjEwNjc0MzUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 9fda98668c70bb8b4b5124aa84a4f778488d49be33fcd811e723ffcafbc32a5c |
| hovercard-subject-tag | issue:44744196 |
| 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/807/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ded65314b361e50a2ee7b11a9137ad2e33eb628e4707e2d7b0db3987f35669fe/microsoft/TypeScript/issues/807 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ded65314b361e50a2ee7b11a9137ad2e33eb628e4707e2d7b0db3987f35669fe/microsoft/TypeScript/issues/807 |
| og:image:alt | declare function f |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | JsonFreeman |
| hostname | github.com |
| expected-hostname | github.com |
| None | c710a5cb5c47be60abfe6e8410436d409906979dbed614ef09f29c60f5535b08 |
| 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 | be616a2a6ec1c609d6e002896dff5352d5c5f28b |
| ui-target | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width