René's URL Explorer Experiment


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 const notBar: Bar = () => { } // passes on 2.4.1 and 2.5....

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 const notBar: Bar...

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

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@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-profiling0
react-import-mapreact,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-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:7f547592-8309-f2a7-7791-81496f5166ab
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id8F48:882E2:384944:4C609F:6B00C5C5
html-safe-nonce5b2f9c0f705cf27241adaa5ef78e644f4bc7faaf081c61f2e09caea482f0bfc8
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RjQ4Ojg4MkUyOjM4NDk0NDo0QzYwOUY6NkIwMEM1QzUiLCJ2aXNpdG9yX2lkIjoiNzU2MTA2MDUyMzYwOTk5ODc4OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac8d013c8d0e11d261854b9a5b602c22a03efedcef737bae154cec1d71f726b528
hovercard-subject-tagissue:241230833
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/TypeScript/17003/issue_layout
twitter:imagehttps://opengraph.githubassets.com/96daa3db9d2773aaf76701e526287a0f831183caea17dfda41a0140ed6e44743/microsoft/TypeScript/issues/17003
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/96daa3db9d2773aaf76701e526287a0f831183caea17dfda41a0140ed6e44743/microsoft/TypeScript/issues/17003
og:image:altTypeScript 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 const notBar: Bar...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameluke-john
hostnamegithub.com
expected-hostnamegithub.com
None98dc00e171c204462a6f367482a0f8c3c6b5dbca99cd7390e82d2df49ce096e4
turbo-cache-controlno-preview
go-importgithub.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git
octolytics-dimension-user_id6154722
octolytics-dimension-user_loginmicrosoft
octolytics-dimension-repository_id20929025
octolytics-dimension-repository_nwomicrosoft/TypeScript
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id20929025
octolytics-dimension-repository_network_root_nwomicrosoft/TypeScript
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releaseef013399cf0a3c324bea644a685d7c1e0f06b5b7
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/microsoft/TypeScript/issues/17003#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F17003
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F17003
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=microsoft%2FTypeScript
Reloadhttps://github.com/microsoft/TypeScript/issues/17003
Reloadhttps://github.com/microsoft/TypeScript/issues/17003
Reloadhttps://github.com/microsoft/TypeScript/issues/17003
microsofthttps://github.com/microsoft
TypeScripthttps://github.com/microsoft/TypeScript
Codehttps://github.com/microsoft/TypeScript
Issues5k (5k)https://github.com/microsoft/TypeScript/issues
Pull requests307 (307)https://github.com/microsoft/TypeScript/pulls
Actionshttps://github.com/microsoft/TypeScript/actions
Projectshttps://github.com/microsoft/TypeScript/projects
Wikihttps://github.com/microsoft/TypeScript/wiki
Security and qualityhttps://github.com/microsoft/TypeScript/security
Insightshttps://github.com/microsoft/TypeScript/insights
https://github.com/microsoft/TypeScript
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/17003
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/17003
Partials accept functionshttps://github.com/microsoft/TypeScript/issues/17003#top
QuestionAn issue which isn't directly actionable in codehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Question%22
https://github.com/luke-john
Luke John (luke-john)https://github.com/luke-john
on Jul 7, 2017https://github.com/microsoft/TypeScript/issues/17003#issue-241230833
typescript-playground-examplehttps://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
13132https://github.com/Microsoft/TypeScript/issues/13132
7485https://github.com/Microsoft/TypeScript/issues/7485
16047https://github.com/Microsoft/TypeScript/pull/16047
Luke John (luke-john)https://github.com/luke-john
on Jul 7, 2017https://github.com/microsoft/TypeScript/issues/17003#event-1154287797
https://github.com/kitsonk
Kitson Kelly (kitsonk)https://github.com/kitsonk
on Jul 7, 2017https://github.com/microsoft/TypeScript/issues/17003#issuecomment-313654133
TypeScript FAQshttps://github.com/Microsoft/TypeScript/wiki/FAQ#why-are-functions-with-fewer-parameters-assignable-to-functions-that-take-more-parameters
https://github.com/luke-john
Luke John (luke-john)https://github.com/luke-john
on Jul 7, 2017https://github.com/microsoft/TypeScript/issues/17003#issuecomment-313657758
https://github.com/kitsonk
Kitson Kelly (kitsonk)https://github.com/kitsonk
on Jul 7, 2017https://github.com/microsoft/TypeScript/issues/17003#issuecomment-313661209
https://github.com/luke-john
Luke John (luke-john)https://github.com/luke-john
on Jul 8, 2017https://github.com/microsoft/TypeScript/issues/17003#issuecomment-313829447
typescript-playground-examplehttps://www.typescriptlang.org/play/#src=type%20ValueOne%20%3D%20%7B%0D%0A%20%20%20%20valueOne%3A%20'value-one'%0D%0A%7D%0D%0A%0D%0Atype%20ValueTwo%20%3D%20%7B%0D%0A%20%20%20%20valueTwo%3A%20'value-two'%0D%0A%7D%0D%0A%0D%0Atype%20SingleValue%20%3D%20%0D%0A%20%20%20%20%7C%20ValueOne%0D%0A%20%20%20%20%7C%20ValueTwo%0D%0A%0D%0Atype%20MultiValue%20%3D%0D%0A%20%20%20%20%26%20Partial%3C%0D%0A%20%20%20%20%20%20%20%20%26%20ValueOne%0D%0A%20%20%20%20%20%20%20%20%26%20ValueTwo%0D%0A%20%20%20%20%3E%0D%0A%20%20%20%20%26%20SingleValue%0D%0A%0D%0Atype%20Value%20%3D%20SingleValue%20%7C%20MultiValue%0D%0A%0D%0Atype%20Method%20%3D%20()%20%3D%3E%20Value%0D%0A%0D%0Atype%20Argument%20%3D%20Method%20%7C%20Value%0D%0A%0D%0Atype%20Library%20%3D%20(argument%3A%20Argument)%20%3D%3E%20void%0D%0A%0D%0Aconst%20library%3A%20Library%20%3D%20(props)%20%3D%3E%20%7B%7D%0D%0A%0D%0Alibrary(%7B%0D%0A%7D)%0D%0A%0D%0Alibrary(()%20%3D%3E%20(%7B%0D%0A%7D))
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
QuestionAn issue which isn't directly actionable in codehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Question%22
on Jul 9, 2017https://github.com/microsoft/TypeScript/issues/17003#event-1155969037
https://github.com/luke-john
Luke John (luke-john)https://github.com/luke-john
on Jul 10, 2017https://github.com/microsoft/TypeScript/issues/17003#issuecomment-314064895
typescript playground examplehttps://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%0D%0A%20%20%20%20%5Bkey%3A%20string%5D%3A%20string%20%7C%20number%20%7C%20undefined%0D%0A%7D%0D%0A%0D%0Atype%20Bar%3CBaz%3E%20%3D%0D%0A%20%20%20%20%7C%20Partial%3CBaz%3E%0D%0A%20%20%20%20%7C%20(%0D%0A%20%20%20%20%20%20%20%20()%20%3D%3E%20Partial%3CBaz%3E%0D%0A%20%20%20%20)%0D%0A%0D%0Aconst%20notBar%3A%20Bar%3CFoo%3E%20%3D%20()%20%3D%3E%20%7B%20%7D%20%2F%2F%20fails%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
Luke John (luke-john)https://github.com/luke-john
completedhttps://github.com/microsoft/TypeScript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Jul 10, 2017https://github.com/microsoft/TypeScript/issues/17003#event-1156530232
https://github.com/luke-john
Luke John (luke-john)https://github.com/luke-john
on Jul 14, 2017https://github.com/microsoft/TypeScript/issues/17003#issuecomment-315254219
typescript-playground-examplehttp://www.typescriptlang.org/play/#src=interface%20StylesComplete%20%7B%0D%0A%20%20propA%3A%20'letter%20a'%20%7C%20'a'%2C%0D%0A%20%20propB%3A%20'letter%20b'%20%7C%20'b'%2C%0D%0A%7D%0D%0A%0D%0A%2F%2F%20A%20Partial%20on%20an%20interface%20will%20normally%20accept%20arbitrary%20functions%0D%0A%2F%2F%20due%20to%20partials%20accepting%20empty%20objects%20which%20validate%20to%20anything%20in%0D%0A%2F%2F%20typescript%0D%0Aconst%20doesNotFail%3A%20Partial%3CStylesComplete%3E%20%3D%20()%20%3D%3E%20%7B%20%7D%0D%0A%0D%0A%0D%0A%0D%0Ainterface%20StylesLossy%20%7B%0D%0A%20%20%5Bkey%3A%20string%5D%3A%20string%20%7C%20undefined%0D%0A%7D%0D%0A%0D%0Atype%20Styles%20%3D%0D%0A%20%20%26%20StylesComplete%0D%0A%20%20%26%20StylesLossy%0D%0A%0D%0A%2F%2F%20intersection%20of%0D%0A%2F%2F%20*%20an%20interface%20containing%20random%20props%0D%0A%2F%2F%20*%20index%20signature%20interface%0D%0A%2F%2F%20allows%20%20you%20to%20do%20a%20partial%20which%20will%20succesfully%20fail%20on%20arbitrary%0D%0A%2F%2F%20functions.%0D%0A%0D%0A%2F%2F%20succesfully%20fails%0D%0Aconst%20doesFail%3A%20Partial%3CStyles%3E%20%3D%20()%20%3D%3E%20%7B%20%7D%0D%0A
microsofthttps://github.com/microsoft
on Jun 14, 2018https://github.com/microsoft/TypeScript/issues/17003#event-1682142224
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoft/TypeScript/issues/17003
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/17003
QuestionAn issue which isn't directly actionable in codehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Question%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.