Title: bind(), call(), and apply() are untyped · Issue #212 · microsoft/TypeScript · GitHub
Open Graph Title: bind(), call(), and apply() are untyped · Issue #212 · microsoft/TypeScript
X Title: bind(), call(), and apply() are untyped · Issue #212 · microsoft/TypeScript
Description: bind() returns type 'any' and does not type check it's arguments. e.g. var add = function (a: number, b: number) { return a + b; }; var addString = add.bind(null, 'hello'); compiles without error and 'addString' has type any. bind is a d...
Open Graph Description: bind() returns type 'any' and does not type check it's arguments. e.g. var add = function (a: number, b: number) { return a + b; }; var addString = add.bind(null, 'hello'); compiles without error a...
X Description: bind() returns type 'any' and does not type check it's arguments. e.g. var add = function (a: number, b: number) { return a + b; }; var addString = add.bind(null, 'hello'); comp...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/212
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"bind(), call(), and apply() are untyped","articleBody":"bind() returns type 'any' and does not type check it's arguments. e.g.\n\n```\nvar add = function (a: number, b: number) { return a + b; };\nvar addString = add.bind(null, 'hello');\n```\n\ncompiles without error and 'addString' has type any. \n\nbind is a default way to achieve partial application so it would be great to have it typechecked properly.\n\nSimilarly for apply, the code\n\n```\nvar listA = [1, 2, 3];\nvar listB = ['a', 'b', 'c'];\nlistA.push.apply(listA, listB);\n```\n\ncompiles without error and listA is still incorrectly marked as type 'number[]'.\n\ncall() example:\n\n```\nvar add5 = function (a: number) { return 5 + a; };\nadd5.call(null, 'a string');\n```\n\nAgain without a compiler error.\n","author":{"url":"https://github.com/jameslong","@type":"Person","name":"jameslong"},"datePublished":"2014-07-23T09:13:20.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":53},"url":"https://github.com/212/TypeScript/issues/212"}
| 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:1dbdcbd8-389b-dd09-8a51-d82cd87e68bd |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C9FA:DDCD5:78EA9A:A178AB:6A618481 |
| html-safe-nonce | 8e96cc11cde51f24db4a93c5e20c4c22bcd23d4f9fee5a2555451ca3f40e2b8d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDOUZBOkREQ0Q1Ojc4RUE5QTpBMTc4QUI6NkE2MTg0ODEiLCJ2aXNpdG9yX2lkIjoiNDk2NDAyNzkzNTgzMTk4MzIzMyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 6435d1303b88ce98cec9cdd0e7f86d17eb9dae0033a13a15600fbbc402d26f40 |
| hovercard-subject-tag | issue:38510974 |
| 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/212/issue_layout |
| twitter:image | https://opengraph.githubassets.com/6533f3c956bc955199c84ea51ba86d29e4b4cb0c1fdc5d1c284c8a503518df32/microsoft/TypeScript/issues/212 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/6533f3c956bc955199c84ea51ba86d29e4b4cb0c1fdc5d1c284c8a503518df32/microsoft/TypeScript/issues/212 |
| og:image:alt | bind() returns type 'any' and does not type check it's arguments. e.g. var add = function (a: number, b: number) { return a + b; }; var addString = add.bind(null, 'hello'); compiles without error a... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jameslong |
| hostname | github.com |
| expected-hostname | github.com |
| None | c28c2f6607f2aacbd934868d997038895c9780d08babfe918550d73773326f4c |
| 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 | cd05235d52ffb3318513d883a56c87a121015c8b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width