Title: Partials accept functions · Issue #17003 · microsoft/TypeScript · GitHub
Open Graph Title: Partials accept functions · Issue #17003 · microsoft/TypeScript
X Title: Partials accept functions · Issue #17003 · microsoft/TypeScript
Description: TypeScript Version: 2.4.0 / nightly (2.5.0-dev.201xxxxx) 2.4.1 and 2.5.0-dev.20170629 and 2.5.0-dev.20170707 Code interface Foo { cat: string bar: number } type Bar = Partial
Open Graph Description: TypeScript Version: 2.4.0 / nightly (2.5.0-dev.201xxxxx) 2.4.1 and 2.5.0-dev.20170629 and 2.5.0-dev.20170707 Code interface Foo { cat: string bar: number } type Bar = Partial
X Description: TypeScript Version: 2.4.0 / nightly (2.5.0-dev.201xxxxx) 2.4.1 and 2.5.0-dev.20170629 and 2.5.0-dev.20170707 Code interface Foo { cat: string bar: number } type Bar = Partial<Foo> const notBa...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/17003
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Partials accept functions","articleBody":"**TypeScript Version:** 2.4.0 / nightly (2.5.0-dev.201xxxxx)\r\n\r\n2.4.1 and 2.5.0-dev.20170629 and 2.5.0-dev.20170707\r\n\r\n**Code**\r\n\r\n```ts\r\ninterface Foo {\r\n cat: string\r\n bar: number\r\n}\r\n\r\ntype Bar = Partial\u003cFoo>\r\n\r\nconst notBar: Bar = () => { } // passes on 2.4.1 and 2.5.0-dev.20170629 and 2.5.0-dev.20170707\r\n```\r\n\r\n**Expected behavior:**\r\n\r\nPartials should not accept functions\r\n\r\n**Actual behavior:**\r\n\r\nPartials accept functions\r\n\r\n[typescript-playground-example](https://www.typescriptlang.org/play/#src=interface%20Foo%20%7B%0D%0A%20%20%20%20cat%3A%20string%0D%0A%20%20%20%20bar%3A%20number%0D%0A%7D%0D%0A%0D%0Atype%20Bar%3CBaz%3E%20%3D%20Partial%3CBaz%3E%0D%0A%0D%0Aconst%20notBar%3A%20Bar%3CFoo%3E%20%3D%20()%20%3D%3E%20%7B%20%7D%20%2F%2F%20passes%20on%202.4.1%20and%202.5.0-dev.20170629%20%0D%0A%0D%0Aconst%20alsoNotBar%3A%20Bar%3CFoo%3E%20%3D%20'test'%20%2F%2F%20fails%20on%202.4.1%0D%0A%0D%0Aconst%20alsoAlsoNotBar%3A%20Bar%3CFoo%3E%20%3D%20false%20%2F%2F%20fails%20on%202.4.1)\r\n\r\n**Related Issues:**\r\n\r\n[13132](https://github.com/Microsoft/TypeScript/issues/13132) has been marked as a duplicate of [7485](https://github.com/Microsoft/TypeScript/issues/7485) which has been closed\r\n\r\n7485 is meant was meant to be closed by [16047](https://github.com/Microsoft/TypeScript/pull/16047) which has merged.\r\n\r\nEdit: updated after testing on latest nightly and simplified example code\r\n\r\n\r\n","author":{"url":"https://github.com/luke-john","@type":"Person","name":"luke-john"},"datePublished":"2017-07-07T11:01:01Z","url":"https://github.com/microsoft/TypeScript/issues/17003"}
| 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:7f547592-8309-f2a7-7791-81496f5166ab |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8F48:882E2:384944:4C609F:6B00C5C5 |
| html-safe-nonce | 5b2f9c0f705cf27241adaa5ef78e644f4bc7faaf081c61f2e09caea482f0bfc8 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RjQ4Ojg4MkUyOjM4NDk0NDo0QzYwOUY6NkIwMEM1QzUiLCJ2aXNpdG9yX2lkIjoiNzU2MTA2MDUyMzYwOTk5ODc4OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 8d013c8d0e11d261854b9a5b602c22a03efedcef737bae154cec1d71f726b528 |
| hovercard-subject-tag | issue:241230833 |
| 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/17003/issue_layout |
| twitter:image | https://opengraph.githubassets.com/96daa3db9d2773aaf76701e526287a0f831183caea17dfda41a0140ed6e44743/microsoft/TypeScript/issues/17003 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/96daa3db9d2773aaf76701e526287a0f831183caea17dfda41a0140ed6e44743/microsoft/TypeScript/issues/17003 |
| og:image:alt | TypeScript Version: 2.4.0 / nightly (2.5.0-dev.201xxxxx) 2.4.1 and 2.5.0-dev.20170629 and 2.5.0-dev.20170707 Code interface Foo { cat: string bar: number } type Bar = Partial |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | luke-john |
| hostname | github.com |
| expected-hostname | github.com |
| None | 98dc00e171c204462a6f367482a0f8c3c6b5dbca99cd7390e82d2df49ce096e4 |
| 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 | ef013399cf0a3c324bea644a685d7c1e0f06b5b7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width