Title: Generics with 'extends' for return types cause type check failure. · Issue #13993 · microsoft/TypeScript · GitHub
Open Graph Title: Generics with 'extends' for return types cause type check failure. · Issue #13993 · microsoft/TypeScript
X Title: Generics with 'extends' for return types cause type check failure. · Issue #13993 · microsoft/TypeScript
Description: TypeScript Version: 2.2.0 Code interface I { attr: string } type M =
Open Graph Description: TypeScript Version: 2.2.0 Code interface I { attr: string } type M =
X Description: TypeScript Version: 2.2.0 Code interface I { attr: string } type M = <T extends I>() => T const v: M = () => ({}) v().attr Expected behavior: Type '() => {}' is not assignabl...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/13993
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Generics with 'extends' for return types cause type check failure.","articleBody":"\u003c!-- BUGS: Please use this template. -->\r\n\u003c!-- QUESTIONS: This is not a general support forum! Ask Qs at http://stackoverflow.com/questions/tagged/typescript -->\r\n\u003c!-- SUGGESTIONS: See https://github.com/Microsoft/TypeScript-wiki/blob/master/Writing-Good-Design-Proposals.md -->\r\n\r\n**TypeScript Version:** 2.2.0\r\n\r\n**Code**\r\n\r\n```ts\r\ninterface I { attr: string }\r\n\r\ntype M = \u003cT extends I>() => T\r\nconst v: M = () => ({})\r\n\r\nv().attr\r\n```\r\n\r\n**Expected behavior:**\r\n\r\n`Type '() => {}' is not assignable to type 'M'.\r\n Type '{}' is not assignable to type 'I'.`\r\n\r\n**Actual behavior:**\r\n\r\nThe compilation is successful.","author":{"url":"https://github.com/na-o-ys","@type":"Person","name":"na-o-ys"},"datePublished":"2017-02-10T09:05:41Z","url":"https://github.com/microsoft/TypeScript/issues/13993"}
| 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:8846faed-5d48-2484-6763-6224f0beafe3 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 83EE:269AD9:A15906:D976AC:6B00ECAB |
| html-safe-nonce | 23753ac2de6f07a2ec893db8a0300db306fafdc4add5e845bd09c8fafb0b170e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4M0VFOjI2OUFEOTpBMTU5MDY6RDk3NkFDOjZCMDBFQ0FCIiwidmlzaXRvcl9pZCI6Ijc0NjQ0OTQ4NTQwNDM2NTk0MzUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | d18ad9f8266e98363d8d1c980a7b043f39d9c8074ecac5f8cb8fdf11e27f00a0 |
| hovercard-subject-tag | issue:206742489 |
| 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/13993/issue_layout |
| twitter:image | https://opengraph.githubassets.com/5015cbdae1aa33e5291d67428897a6ffc014b9d73027eb54685146e84b3bd576/microsoft/TypeScript/issues/13993 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/5015cbdae1aa33e5291d67428897a6ffc014b9d73027eb54685146e84b3bd576/microsoft/TypeScript/issues/13993 |
| og:image:alt | TypeScript Version: 2.2.0 Code interface I { attr: string } type M = |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | na-o-ys |
| 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