Title: Generic lambda identity function can cheat typesystem easily · Issue #8397 · microsoft/TypeScript · GitHub
Open Graph Title: Generic lambda identity function can cheat typesystem easily · Issue #8397 · microsoft/TypeScript
X Title: Generic lambda identity function can cheat typesystem easily · Issue #8397 · microsoft/TypeScript
Description: Hi. Before I start I want to emphasize that I googled a lot for that problem and found nothing. That being said, my problem seems to be so simple, that I am sure it was discussed before. If that is the case forgive me for spam. I would b...
Open Graph Description: Hi. Before I start I want to emphasize that I googled a lot for that problem and found nothing. That being said, my problem seems to be so simple, that I am sure it was discussed before. If that is...
X Description: Hi. Before I start I want to emphasize that I googled a lot for that problem and found nothing. That being said, my problem seems to be so simple, that I am sure it was discussed before. If that is...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/8397
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Generic lambda identity function can cheat typesystem easily","articleBody":"Hi. Before I start I want to emphasize that I googled a lot for that problem and found nothing. That being said, my problem seems to be so simple, that I am sure it was discussed before. If that is the case forgive me for spam. I would be just grateful for some link to the explanation of why TS works here the way it works.\n\nI use TypeScript 1.8.10\n\nSo... this does not compile (which is good):\n\n``` typescript\nfunction id \u003cA> (a : A) : A {\n return \"string\";\n}\n```\n\nThis however DOES (which for me seems super bad):\n\n``` typescript\nconst id :\u003cA>(a : A) => A = a => \"string\";\n\nvar x : number = id\u003cnumber>(5); // compiler does not complain at all :(\n```\n","author":{"url":"https://github.com/mpodlasin","@type":"Person","name":"mpodlasin"},"datePublished":"2016-04-30T10:27:37Z","url":"https://github.com/microsoft/TypeScript/issues/8397"}
| 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:66b3ffbb-6078-bdae-823f-b896e5a55557 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CB72:3A4875:829B4E:AF8BCA:6B00E08D |
| html-safe-nonce | e73fadc30e1a4c5b82bca745589f47383d285f4e0fb6ec944ccd8be221d4398d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQjcyOjNBNDg3NTo4MjlCNEU6QUY4QkNBOjZCMDBFMDhEIiwidmlzaXRvcl9pZCI6IjE0NDg3NjEyODA0MDcwNjg4MTMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | c3790b08228fd97a6923f109c948c0dd707ad3502bd888389a8353b56245f75c |
| hovercard-subject-tag | issue:152022585 |
| 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/8397/issue_layout |
| twitter:image | https://opengraph.githubassets.com/4c71def1ff7a363114f082d00a59c1ea497545ad81487752d38fcda0ed1f5972/microsoft/TypeScript/issues/8397 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/4c71def1ff7a363114f082d00a59c1ea497545ad81487752d38fcda0ed1f5972/microsoft/TypeScript/issues/8397 |
| og:image:alt | Hi. Before I start I want to emphasize that I googled a lot for that problem and found nothing. That being said, my problem seems to be so simple, that I am sure it was discussed before. If that is... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mpodlasin |
| hostname | github.com |
| expected-hostname | github.com |
| None | 043c3f30fbcbe2c6c8e729e10cbbbc90c406546f9fbbb67c648d38f6b7d16daf |
| 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 | 5425dc24e8bd8d6fca9641a12afc984825a43875 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width