Title: Design Meeting Notes, 12/16/2016 · Issue #12997 · microsoft/TypeScript · GitHub
Open Graph Title: Design Meeting Notes, 12/16/2016 · Issue #12997 · microsoft/TypeScript
X Title: Design Meeting Notes, 12/16/2016 · Issue #12997 · microsoft/TypeScript
Description: Intrinsic object Type (#12501) Can't be an object-type (in terms of how the spec/compiler defines object types). This is more like a primitive. Don't want it to be assignable to any other primitive. Will have an apparent type of Object. ...
Open Graph Description: Intrinsic object Type (#12501) Can't be an object-type (in terms of how the spec/compiler defines object types). This is more like a primitive. Don't want it to be assignable to any other primitive...
X Description: Intrinsic object Type (#12501) Can't be an object-type (in terms of how the spec/compiler defines object types). This is more like a primitive. Don't want it to be assignable to any other p...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/12997
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Design Meeting Notes, 12/16/2016","articleBody":"# Intrinsic `object` Type (#12501)\r\n\r\nCan't be an object-type (in terms of how the spec/compiler defines object types).\r\nThis is more like a primitive.\r\n\r\n* Don't want it to be assignable to any other primitive.\r\n* Will have an apparent type of `Object`.\r\n* Anything is assignable to `{}` (and almost anything is assignable to `Object`).\r\n * So `object` should be assignable to `{}` and `Object`.\r\n * What about `Function`?\r\n * Hesitance about agreement.\r\n * Saying \"no\" means you can never pass in anything with a call signature.\r\n * But functions *are* objects.\r\n * Does it have it in its prototype?\r\n* This is \"cheatable\" construct (i.e. `number` -> `Number` -> `object`).\r\n * Yes, but this largely an intent-based construct.\r\n Covers a majority of the use-cases.\r\n* What about people who want to ensure that you are an object with some set of optional properties?\r\n * People may write `object & { a?, b?, c? }`.\r\n * And subsequently `type ObjectOf\u003cT> = object & t`.\r\n * Nobody will figure that out.\r\n * Well someone absolutely will, and why shouldn't they do this?\r\n * But implementing weak types would avoid some of the issues with this.\r\n * Are we implementing weak types?\r\n * Potentially.\r\n * Well then people are going to write this!\r\n * Kind of unfortunate that when people write `{ a?, b?, c? }` they truly do mean they only want an object-type.\r\n* A lot of the ideas being discussed at this meeting have to do with weak types, exact types, etc.\r\n\r\nConclusion:\r\n\r\n* :+1: for `object`, still need to think about exact types.\r\n* Current PR needs some changes, let's work with @HerringtonDarkholme to get that done.\r\n\r\n# Excess Property Checks on Union types (#12745)\r\n\r\nIs a pretty complex problem.\r\n\r\n* Currently we disable excess property checks for intersections and unions.\r\n * Why intersections?\r\n * Nobody is sure. We just did it?\r\n * Let's not do that.\r\n\r\n#12904\r\n\r\n* This is not excess property checking, this is weak type checks.\r\n* Some of the conversation here has to do with the idea of flattening intersections of solely object types.\r\n * But makes inference problematic.\r\n * But it doesn't quite work with object literals anyway.\r\n * Still happens in other places.\r\n * We could create a type that knows about its originating type (i.e. a special object type that knows about its original intersection type).\r\n\r\n\r\nOptions:\r\n\r\n* Union type property checks\r\n* Weak types\r\n* Exact types\r\n\r\n* If we did exact types\r\n * Could you write exact interfaces?\r\n * How does it play with intersections?\r\n * Could you have an exact type parameter? What does it mean to have a generic exact type?\r\n\r\n* If we did weak type detection\r\n * A heuristic.\r\n * Will likely catch a good class of bugs.\r\n * But doesn't quite have the full power of an exact type.\r\n\r\n# Freshness Maintenance for Object Spread (#12717)\r\n\r\n* Is there any reason why we shouldn't do it?\r\n* No.\r\n* Seems like a bug.\r\n* Let's do it\r\n* Wait.\r\n* Ehhh.\r\n* But.\r\n* Actually.\r\n* It's arguable.\r\n\r\nConclusion: No.\r\n\r\n(Reason: freshness checking was to catch issues for things like options bags - this sounds more like a potential case for exact types)","author":{"url":"https://github.com/DanielRosenwasser","@type":"Person","name":"DanielRosenwasser"},"datePublished":"2016-12-17T05:49:03Z","url":"https://github.com/microsoft/TypeScript/issues/12997"}
| 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:c583b1d4-2a7c-79a4-5b55-06a53c6af11d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 96CE:81DA9:58C88B:7A0A71:6B009487 |
| html-safe-nonce | 3df9e6c888867459d75237339e1d727995d461aa03de5c8940b5c1cad29a91bc |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NkNFOjgxREE5OjU4Qzg4Qjo3QTBBNzE6NkIwMDk0ODciLCJ2aXNpdG9yX2lkIjoiNTcyMjk5NjQwODQ5MjAwNDQ4NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | c8545333779cf07f12c5eb9f8e47fc83c6567c2e12991584a3b54eb645f35c5a |
| hovercard-subject-tag | issue:196201464 |
| 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/12997/issue_layout |
| twitter:image | https://opengraph.githubassets.com/6b70bda2ef56111d0d3996fcc99a27db105a013d2a093f8ae1af986b5b9e7516/microsoft/TypeScript/issues/12997 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/6b70bda2ef56111d0d3996fcc99a27db105a013d2a093f8ae1af986b5b9e7516/microsoft/TypeScript/issues/12997 |
| og:image:alt | Intrinsic object Type (#12501) Can't be an object-type (in terms of how the spec/compiler defines object types). This is more like a primitive. Don't want it to be assignable to any other primitive... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | DanielRosenwasser |
| hostname | github.com |
| expected-hostname | github.com |
| None | 552480023d6963d7f188d82f8cd5f3fe5046244607d769b794462821d9ea1b29 |
| 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 | caf54e38b10face642f6cc1c79e4562e7ee52e3c |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width