Title: Better propagation of type predicate signatures · Issue #12798 · microsoft/TypeScript · GitHub
Open Graph Title: Better propagation of type predicate signatures · Issue #12798 · microsoft/TypeScript
X Title: Better propagation of type predicate signatures · Issue #12798 · microsoft/TypeScript
Description: declare function isNumber(value: {}): value is number; declare const values: {}[]; declare function filterAs(values: a[], isIt: (value: a) => value is b): b[]; const yayNumbers = filterAs(values, isNumber); // number[] co...
Open Graph Description: declare function isNumber(value: {}): value is number; declare const values: {}[]; declare function filterAs(values: a[], isIt: (value: a) => value is b): b[]; const yayNumbers = fi...
X Description: declare function isNumber(value: {}): value is number; declare const values: {}[]; declare function filterAs<a, b extends a>(values: a[], isIt: (value: a) => value is b): b[]; const yayNum...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/12798
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Better propagation of type predicate signatures","articleBody":"```typescript\r\ndeclare function isNumber(value: {}): value is number;\r\ndeclare const values: {}[];\r\ndeclare function filterAs\u003ca, b extends a>(values: a[], isIt: (value: a) => value is b): b[];\r\nconst yayNumbers = filterAs(values, isNumber); // number[]\r\nconst ohNoNotAgain = filterAs(values, x => isNumber(x)); /* \u003c-- expected to work,\r\nactual: Argument of type '(x: {}) => boolean' is not assignable to parameter of type '(value: {}) => value is {}'.\r\n Signature '(x: {}): boolean' must have a type predicate. */\r\n```","author":{"url":"https://github.com/zpdDG4gta8XKpMCd","@type":"Person","name":"zpdDG4gta8XKpMCd"},"datePublished":"2016-12-09T13:59:47Z","url":"https://github.com/microsoft/TypeScript/issues/12798"}
| 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:40662eed-24dd-b8e7-8da3-0764fb53a1ca |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9944:3F8A67:A98B81:E387F7:6B00F232 |
| html-safe-nonce | 2ec556d48b5e4dfc456562187dd54dfdb97a110e0d6d5d17f4ba52654bf157dc |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5OTQ0OjNGOEE2NzpBOThCODE6RTM4N0Y3OjZCMDBGMjMyIiwidmlzaXRvcl9pZCI6IjM1MjE4MDkyODM5OTE3OTQyMjciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 5332a4963f176646f491bdd850cebb783bdc24603dacf96ae423357930c48c83 |
| hovercard-subject-tag | issue:194603155 |
| 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/12798/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ec198555a0883d78ff05efd9ad1709de99dc5b5a1543c9dadf78763f43fdacb0/microsoft/TypeScript/issues/12798 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ec198555a0883d78ff05efd9ad1709de99dc5b5a1543c9dadf78763f43fdacb0/microsoft/TypeScript/issues/12798 |
| og:image:alt | declare function isNumber(value: {}): value is number; declare const values: {}[]; declare function filterAs(values: a[], isIt: (value: a) => value is b): b[]; const yayNumbers = fi... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | zpdDG4gta8XKpMCd |
| 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