René's URL Explorer Experiment


Title: Two types should only be compatible if their members are compatible - even if all these members are optional · Issue #12904 · microsoft/TypeScript · GitHub

Open Graph Title: Two types should only be compatible if their members are compatible - even if all these members are optional · Issue #12904 · microsoft/TypeScript

X Title: Two types should only be compatible if their members are compatible - even if all these members are optional · Issue #12904 · microsoft/TypeScript

Description: I wanted to see if I can update definitions a MongoDB filter object, which utilizes these expressions. Below is just a start, but I already see an issue when the code compiles when it should not. This issue possibly has similar underlyin...

Open Graph Description: I wanted to see if I can update definitions a MongoDB filter object, which utilizes these expressions. Below is just a start, but I already see an issue when the code compiles when it should not. T...

X Description: I wanted to see if I can update definitions a MongoDB filter object, which utilizes these expressions. Below is just a start, but I already see an issue when the code compiles when it should not. T...

Opengraph URL: https://github.com/microsoft/TypeScript/issues/12904

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Two types should only be compatible if their members are compatible - even if all these members are optional","articleBody":"I wanted to see if I can update definitions a MongoDB filter object, which utilizes [these expressions](https://docs.mongodb.com/manual/reference/operator/query/#query-selectors). Below is just a start, but I already see an issue when the code compiles when it should not. This issue possibly has similar underlying issue as #12769\r\n\r\n**TypeScript Version:**  2.1.4\r\n\r\n**Code**\r\n\r\n```ts\r\ntype MongoFilter\u003cT> = $and\u003cT> | $or\u003cT> | propertyRule\u003cT>;\r\n\r\ntype logical\u003cT> = $and\u003cT> | $or\u003cT>;\r\n\r\ntype $and\u003cT> = { $and: Array\u003clogical\u003cT> | propertyRule\u003cT>> }\r\ntype $or\u003cT> = { $or: Array\u003clogical\u003cT> | propertyRule\u003cT>> }\r\n\r\ntype propertyRule\u003cT> = {\r\n  [P in keyof T]?: T[P] | comparison\u003cT[P]>\r\n}\r\n\r\ntype comparison\u003cV> = $eq\u003cV> | $gt | $lt;\r\n\r\ntype $eq\u003cV> = { $eq: V };\r\ntype $gt = { $gt: number };\r\ntype $lt = { $lt: number };\r\n\r\n// See if MongoFilter works:\r\ninterface Person {\r\n  id: number;\r\n  name: string;\r\n  age: number;\r\n}\r\n\r\n// should compile\r\nlet f1: MongoFilter\u003cPerson> = { $or: [{ id: 1 }, { name: 'dima' }] };\r\nlet f2: MongoFilter\u003cPerson> = { $and: [{ id: 1 }] };\r\nlet f3: MongoFilter\u003cPerson> = { id: 1 };\r\n\r\n// should not compile\r\nlet w1: MongoFilter\u003cPerson> = { wrong: 1 }; // does not compile - good\r\nlet w2: MongoFilter\u003cPerson> = { $or: [{ wrong: 1 }] }; // compiles\r\n```\r\n\r\n**Expected behavior:**\r\nCode below should not compile\r\n```ts\r\nlet w1: MongoFilter\u003cPerson> = { $or: [{ wrong: 1 }] };\r\n```\r\n\r\n**Actual behavior:**\r\nBut it does","author":{"url":"https://github.com/DmitryEfimenko","@type":"Person","name":"DmitryEfimenko"},"datePublished":"2016-12-14T07:54:27Z","url":"https://github.com/microsoft/TypeScript/issues/12904"}

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:a8179e47-0915-43c2-d96c-2d8511432069
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id87DC:2409E2:4C8EBA:663DD5:6B00A532
html-safe-nonce3f23ab0fbca95db5bd7e580fc529c48c77d468ac9a37f1812176f251c2e489a2
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4N0RDOjI0MDlFMjo0QzhFQkE6NjYzREQ1OjZCMDBBNTMyIiwidmlzaXRvcl9pZCI6Ijg3MTA2MTAwNzUxNjI1NTE2MDIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacc34222c998764f9af536884353d709d8715e556de9a5bf9aa3fb7129bb32e7d8
hovercard-subject-tagissue:195463287
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/12904/issue_layout
twitter:imagehttps://opengraph.githubassets.com/011c2844509aa75a2acf2ba6f65c448b518385327d92359f2a8d807db0dc01b1/microsoft/TypeScript/issues/12904
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/011c2844509aa75a2acf2ba6f65c448b518385327d92359f2a8d807db0dc01b1/microsoft/TypeScript/issues/12904
og:image:altI wanted to see if I can update definitions a MongoDB filter object, which utilizes these expressions. Below is just a start, but I already see an issue when the code compiles when it should not. T...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameDmitryEfimenko
hostnamegithub.com
expected-hostnamegithub.com
None455b493e3402a3a3a06beac5d20bb7db3da060808b220aa48d6a7eca7c59863a
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
release2f575159976167242d488c0b062eb355c4e198b7
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/microsoft/TypeScript/issues/12904#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F12904
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%2F12904
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/12904
Reloadhttps://github.com/microsoft/TypeScript/issues/12904
Reloadhttps://github.com/microsoft/TypeScript/issues/12904
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/12904
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/12904
Two types should only be compatible if their members are compatible - even if all these members are optionalhttps://github.com/microsoft/TypeScript/issues/12904#top
FixedA PR has been merged for this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Fixed%22
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
TypeScript 2.4https://github.com/microsoft/TypeScript/milestone/43
https://github.com/DmitryEfimenko
Dmitry A. Efimenko (DmitryEfimenko)https://github.com/DmitryEfimenko
on Dec 14, 2016https://github.com/microsoft/TypeScript/issues/12904#issue-195463287
these expressionshttps://docs.mongodb.com/manual/reference/operator/query/#query-selectors
#12769https://github.com/microsoft/TypeScript/issues/12769
https://github.com/PyroVortex
PyroVortexhttps://github.com/PyroVortex
on Dec 14, 2016https://github.com/microsoft/TypeScript/issues/12904#issuecomment-267166560
https://github.com/DmitryEfimenko
Dmitry A. Efimenko (DmitryEfimenko)https://github.com/DmitryEfimenko
on Dec 14, 2016https://github.com/microsoft/TypeScript/issues/12904#issuecomment-267172743
https://github.com/PyroVortex
PyroVortexhttps://github.com/PyroVortex
on Dec 15, 2016https://github.com/microsoft/TypeScript/issues/12904#issuecomment-267196201
https://github.com/DmitryEfimenko
Dmitry A. Efimenko (DmitryEfimenko)https://github.com/DmitryEfimenko
on Dec 15, 2016https://github.com/microsoft/TypeScript/issues/12904#issuecomment-267215290
https://github.com/normalser
normalserhttps://github.com/normalser
on Dec 15, 2016https://github.com/microsoft/TypeScript/issues/12904#issuecomment-267215641
https://github.com/Microsoft/TypeScript/wiki/FAQ#why-are-all-types-assignable-to-empty-interfaceshttps://github.com/Microsoft/TypeScript/wiki/FAQ#why-are-all-types-assignable-to-empty-interfaces
Dmitry A. Efimenko (DmitryEfimenko)https://github.com/DmitryEfimenko
on Dec 15, 2016https://github.com/microsoft/TypeScript/issues/12904#event-894714758
Dmitry A. Efimenko (DmitryEfimenko)https://github.com/DmitryEfimenko
on Dec 15, 2016https://github.com/microsoft/TypeScript/issues/12904#event-894714818
https://github.com/DmitryEfimenko
Dmitry A. Efimenko (DmitryEfimenko)https://github.com/DmitryEfimenko
on Dec 15, 2016https://github.com/microsoft/TypeScript/issues/12904#issuecomment-267238979
https://github.com/DmitryEfimenko
Dmitry A. Efimenko (DmitryEfimenko)https://github.com/DmitryEfimenko
on Dec 15, 2016https://github.com/microsoft/TypeScript/issues/12904#issuecomment-267251347
#12501https://github.com/microsoft/TypeScript/pull/12501
#1809https://github.com/microsoft/TypeScript/issues/1809
S. Chris Colbert (@sccolbert)https://github.com/sccolbert
#9841https://github.com/microsoft/TypeScript/issues/9841
#12914https://github.com/microsoft/TypeScript/issues/12914
#3842https://github.com/microsoft/TypeScript/pull/3842
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
In DiscussionNot yet reached consensushttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22In%20Discussion%22
on Dec 15, 2016https://github.com/microsoft/TypeScript/issues/12904#event-895642780
https://github.com/mhegazy
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
on Dec 15, 2016https://github.com/microsoft/TypeScript/issues/12904#issuecomment-267403623
#12745https://github.com/microsoft/TypeScript/issues/12745
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
on Apr 3, 2017https://github.com/microsoft/TypeScript/issues/12904#event-1027045560
https://github.com/inner-peace
inner-peacehttps://github.com/inner-peace
on Apr 27, 2017https://github.com/microsoft/TypeScript/issues/12904#issuecomment-297741925
https://github.com/mhegazy
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
on Jun 13, 2017https://github.com/microsoft/TypeScript/issues/12904#issuecomment-308267291
#16047https://github.com/microsoft/TypeScript/pull/16047
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
completedhttps://github.com/microsoft/TypeScript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Jun 13, 2017https://github.com/microsoft/TypeScript/issues/12904#event-1122301041
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
FixedA PR has been merged for this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Fixed%22
In DiscussionNot yet reached consensushttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22In%20Discussion%22
on Jun 13, 2017https://github.com/microsoft/TypeScript/issues/12904#event-1122301191
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
TypeScript 2.4https://github.com/microsoft/TypeScript/milestone/43
on Jun 13, 2017https://github.com/microsoft/TypeScript/issues/12904#event-1122301274
microsofthttps://github.com/microsoft
on Jun 19, 2018https://github.com/microsoft/TypeScript/issues/12904#event-1689924886
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoft/TypeScript/issues/12904
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/12904
FixedA PR has been merged for this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Fixed%22
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
TypeScript 2.4https://github.com/microsoft/TypeScript/milestone/43
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.