Title: Negated types · Issue #4196 · microsoft/TypeScript · GitHub
Open Graph Title: Negated types · Issue #4196 · microsoft/TypeScript
X Title: Negated types · Issue #4196 · microsoft/TypeScript
Description: Sometimes it is desired to forbid certain types from being considered. Example: JSON.stringify(function() {}); doesn't make sense and the chance is high it's written like this by mistake. With negated types we could eliminate a chance of...
Open Graph Description: Sometimes it is desired to forbid certain types from being considered. Example: JSON.stringify(function() {}); doesn't make sense and the chance is high it's written like this by mistake. With nega...
X Description: Sometimes it is desired to forbid certain types from being considered. Example: JSON.stringify(function() {}); doesn't make sense and the chance is high it's written like this by mistake. W...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/4196
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Negated types","articleBody":"Sometimes it is desired to forbid certain types from being considered.\n\nExample: `JSON.stringify(function() {});` doesn't make sense and the chance is high it's written like this by mistake. With negated types we could eliminate a chance of it.\n\n``` typescript\ntype Serializable = any ~ Function; // or simply ~ Function\ndeclare interface JSON {\n stringify(value: Serializable): string;\n}\n```\n\nAnother example\n\n``` typescript\n\nexport NonIdentifierExpression = ts.Expression ~ ts.Identifier\n\n```\n","author":{"url":"https://github.com/zpdDG4gta8XKpMCd","@type":"Person","name":"zpdDG4gta8XKpMCd"},"datePublished":"2015-08-06T20:19:48.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":67},"url":"https://github.com/4196/TypeScript/issues/4196"}
| 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:05dd4599-7a57-168c-54df-6a26f40e72ba |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9E08:2A4911:4122D9D:5549538:6A5D2867 |
| html-safe-nonce | 5b8672f05132119bddc5bd74e093c87405d0b43fd59070dc1eec1657244e8364 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RTA4OjJBNDkxMTo0MTIyRDlEOjU1NDk1Mzg6NkE1RDI4NjciLCJ2aXNpdG9yX2lkIjoiMjk2OTE0MTgxMjk3ODg1Mzk5MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | c8c955572f8dd9dccc16706e9da909ffb1a1b3caeeb2d2572e733716dcbf28a6 |
| hovercard-subject-tag | issue:99516790 |
| 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/4196/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d78485be179a5d33fc6084a46eaeb578f5544d721582be0dc6dd3b37b67f09d6/microsoft/TypeScript/issues/4196 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d78485be179a5d33fc6084a46eaeb578f5544d721582be0dc6dd3b37b67f09d6/microsoft/TypeScript/issues/4196 |
| og:image:alt | Sometimes it is desired to forbid certain types from being considered. Example: JSON.stringify(function() {}); doesn't make sense and the chance is high it's written like this by mistake. With nega... |
| 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 | 5290d7e14309ad1e76106a9c4237bd1041517e83ea182c8ab756752cb0c6940b |
| 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 | 9c975978430e9ad293956f2bbdaf153b1bd84a99 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width