René's URL Explorer Experiment


Title: in operator typeguard precision loss · Issue #51339 · microsoft/TypeScript · GitHub

Open Graph Title: in operator typeguard precision loss · Issue #51339 · microsoft/TypeScript

X Title: in operator typeguard precision loss · Issue #51339 · microsoft/TypeScript

Description: Bug Report 🔎 Search Terms 🕗 Version & Regression Information v4.9.0 v4.9.1 5.0.0-dev.20221101 ⏯ Playground Link Playground link with relevant code 💻 Code function addressOrThrow(value: unknown) { if (typeof value !== "object" || value ==...

Open Graph Description: Bug Report 🔎 Search Terms 🕗 Version & Regression Information v4.9.0 v4.9.1 5.0.0-dev.20221101 ⏯ Playground Link Playground link with relevant code 💻 Code function addressOrThrow(value: unknown) { i...

X Description: Bug Report 🔎 Search Terms 🕗 Version & Regression Information v4.9.0 v4.9.1 5.0.0-dev.20221101 ⏯ Playground Link Playground link with relevant code 💻 Code function addressOrThrow(value: unknown)...

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

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.112.4


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"in operator typeguard precision loss","articleBody":"# Bug Report\r\n\r\n### 🔎 Search Terms\r\n\r\n### 🕗 Version & Regression Information\r\n\r\nv4.9.0 v4.9.1 5.0.0-dev.20221101\r\n\r\n### ⏯ Playground Link\r\n\r\n[Playground link with relevant code](https://www.typescriptlang.org/play?ts=4.9.0-dev.20221025#code/GYVwdgxgLglg9mABAQwCaoE4FMDOODyGAKgBYZwDuAFAG7IA2IWAXIuANZiVgCUiA3gChEiGMERUoATwAOWOOLqMsiAIQBedYgBEcAEYArLNG2IAPmcRKmiTYjAh69PlDKV7WCoiKysAUQxyDCoeAG5BYVFxKlUqbRwobCwoUxgkayw+C0RpOQUrBiYAOgSkqDU7eMS0gHNtHkiRV3IvME9vXwCgkPDIsQlY7RI4EBwsADkQAFs9LAxU9MLM80tc+UUlouHRienZjAqtbQcZufrGnLdW9p85LrhgsIiRbCgQDEXlcIBfCNBIWAIFDobB4QikFpEADitCWrA4XAovFYGVEOEQAEEQbh0UIRGhMDjwVdYconi9ku8kIkmD8-uBoPAkHIMDgEMSWqSmPCwJxuHw8VEJGt8qiNEd9EYTCsCspbFoHE4XFcPF5bv5Ag8es8hTE4sAYKyoONkFMsAtZUwsqtfKLNgajSazYcdKVaucRE0VW01Z1NY9eiJ+nrtPRkAknebRJ8rTKRRtlEUwxHTSpxa7qmA6g1PZcWqqOnd-dq+tFtFMYOh6BNUxbUQAyes5W0J4oVqs153pqoYd05z3Ndw+wsa7pPUsDOIE0FjHB1pbWtQYwLIKRFGA4ZcYVdcrBFac43A8fte-PD9X3AM64OqDL77F4XBFLA0OZSKgHsHEK7Q48XQfXL6RZjoGiCvFSlpYHSghrJiD7oloABKlIfOqAA88bAoSX4QpQAB8vSwQACnMbJIEhKFgOhmEsmRHL4aEQA)\r\n\r\n### 💻 Code\r\n\r\n```ts\r\nfunction addressOrThrow(value: unknown) {\r\n  if (typeof value !== \"object\" || value == null) throw new TypeError();\r\n\r\n  if (!(\"street\" in value) || typeof value.street !== \"string\")\r\n    throw new TypeError();\r\n\r\n  if (!(\"houseNumber\" in value) || typeof value.houseNumber !== \"number\")\r\n    throw new TypeError();\r\n\r\n  return value;\r\n}\r\n\r\nfunction addressOrThrowTG(value: unknown): value is Address {\r\n  addressOrThrow(value);\r\n  return true;\r\n}\r\n\r\nfunction personOrThrow(value: unknown) {\r\n  if (typeof value !== \"object\" || value == null) throw new TypeError();\r\n\r\n  if (!(\"firstName\" in value) || typeof value.firstName !== \"string\")\r\n    throw new TypeError();\r\n\r\n  if (!(\"lastName\" in value) || typeof value.lastName !== \"string\")\r\n    throw new TypeError();\r\n\r\n  if (\"middleName\" in value && typeof value.middleName !== \"string\")\r\n    throw new TypeError();\r\n\r\n  if (!(\"addresses\" in value) || !Array.isArray(value.addresses))\r\n    throw new TypeError();\r\n\r\n  if (!value.addresses.every(addressOrThrowTG))\r\n    throw new TypeError();\r\n\r\n  return value;\r\n}\r\n\r\ntype Address = ReturnType\u003ctypeof addressOrThrow>;\r\n\r\ntype Person = ReturnType\u003ctypeof personOrThrow>;\r\n```\r\n\r\n### 🙁 Actual behavior\r\n\r\n`type Address = object & Record\u003c\"street\", unknown> & Record\u003c\"houseNumber\", unknown>`\r\n`type Person = object & Record\u003c\"firstName\", unknown> & Record\u003c\"lastName\", unknown> & Record\u003c\"addresses\", unknown>`\r\n\r\n### 🙂 Expected behavior\r\n\r\n`type Address = object & Record\u003c\"street\", string> & Record\u003c\"houseNumber\", number>`\r\n`type Person = object & Record\u003c\"firstName\", string> & Partial\u003cRecord\u003c\"middleName\", string>> & Record\u003c\"lastName\", string> & Record\u003c\"addresses\", Address[]>`\r\n","author":{"url":"https://github.com/santa-trout","@type":"Person","name":"santa-trout"},"datePublished":"2022-10-28T14:41:28Z","url":"https://github.com/microsoft/TypeScript/issues/51339"}

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:44624270-b34f-a6be-1f17-e4d37afcd36c
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idA404:E2A80:6A9B0F:952066:6B05C2B0
html-safe-nonceb967769c91fb65e65a1268ffff0f5d1eb8eb39236b04bef349647d98f5be8c0e
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNDA0OkUyQTgwOjZBOUIwRjo5NTIwNjY6NkIwNUMyQjAiLCJ2aXNpdG9yX2lkIjoiODc0NDAxNzcwNTE4MDcwOTU1MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacc08b5b73432af6a568acf121806e5e62c67fd95a9c1163de97b6398367848af0
hovercard-subject-tagissue:1427365615
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/51339/issue_layout
twitter:imagehttps://opengraph.githubassets.com/3a5faa13425359bc9c126f6d6b4794575ea7404bd94eba109176610573a1c58e/microsoft/TypeScript/issues/51339
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/3a5faa13425359bc9c126f6d6b4794575ea7404bd94eba109176610573a1c58e/microsoft/TypeScript/issues/51339
og:image:altBug Report 🔎 Search Terms 🕗 Version & Regression Information v4.9.0 v4.9.1 5.0.0-dev.20221101 ⏯ Playground Link Playground link with relevant code 💻 Code function addressOrThrow(value: unknown) { i...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamesanta-trout
hostnamegithub.com
expected-hostnamegithub.com
None708c2f10d746dbcf1dd80dc8309daa7d595df3fce8066244380fc3238618f09c
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
release2a29e3cf4fb57e81fd311774f91f345cc4436f40
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/microsoft/TypeScript/issues/51339#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F51339
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%2F51339
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/51339
Reloadhttps://github.com/microsoft/TypeScript/issues/51339
Reloadhttps://github.com/microsoft/TypeScript/issues/51339
microsofthttps://github.com/microsoft
TypeScripthttps://github.com/microsoft/TypeScript
Codehttps://github.com/microsoft/TypeScript
Issues5k (5k)https://github.com/microsoft/TypeScript/issues
Pull requests323 (323)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/51339
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/51339
in operator typeguard precision losshttps://github.com/microsoft/TypeScript/issues/51339#top
Experience Enhancementhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Experience%20Enhancement%22
Suggestionhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
Backloghttps://github.com/microsoft/TypeScript/milestone/29
https://github.com/santa-trout
santa-trouthttps://github.com/santa-trout
on Oct 28, 2022https://github.com/microsoft/TypeScript/issues/51339#issue-1427365615
Playground link with relevant codehttps://www.typescriptlang.org/play?ts=4.9.0-dev.20221025#code/GYVwdgxgLglg9mABAQwCaoE4FMDOODyGAKgBYZwDuAFAG7IA2IWAXIuANZiVgCUiA3gChEiGMERUoATwAOWOOLqMsiAIQBedYgBEcAEYArLNG2IAPmcRKmiTYjAh69PlDKV7WCoiKysAUQxyDCoeAG5BYVFxKlUqbRwobCwoUxgkayw+C0RpOQUrBiYAOgSkqDU7eMS0gHNtHkiRV3IvME9vXwCgkPDIsQlY7RI4EBwsADkQAFs9LAxU9MLM80tc+UUlouHRienZjAqtbQcZufrGnLdW9p85LrhgsIiRbCgQDEXlcIBfCNBIWAIFDobB4QikFpEADitCWrA4XAovFYGVEOEQAEEQbh0UIRGhMDjwVdYconi9ku8kIkmD8-uBoPAkHIMDgEMSWqSmPCwJxuHw8VEJGt8qiNEd9EYTCsCspbFoHE4XFcPF5bv5Ag8es8hTE4sAYKyoONkFMsAtZUwsqtfKLNgajSazYcdKVaucRE0VW01Z1NY9eiJ+nrtPRkAknebRJ8rTKRRtlEUwxHTSpxa7qmA6g1PZcWqqOnd-dq+tFtFMYOh6BNUxbUQAyes5W0J4oVqs153pqoYd05z3Ndw+wsa7pPUsDOIE0FjHB1pbWtQYwLIKRFGA4ZcYVdcrBFac43A8fte-PD9X3AM64OqDL77F4XBFLA0OZSKgHsHEK7Q48XQfXL6RZjoGiCvFSlpYHSghrJiD7oloABKlIfOqAA88bAoSX4QpQAB8vSwQACnMbJIEhKFgOhmEsmRHL4aEQA
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
Suggestionhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
Help Wantedhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Help%20Wanted%22
Experience Enhancementhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Experience%20Enhancement%22
on Oct 28, 2022https://github.com/microsoft/TypeScript/issues/51339#event-7693283546
https://github.com/RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
on Oct 28, 2022https://github.com/microsoft/TypeScript/issues/51339#issuecomment-1295232334
Anders Hejlsberg (@ahejlsberg)https://github.com/ahejlsberg
https://github.com/arahansen
Andrew Hansen (arahansen)https://github.com/arahansen
on Nov 29, 2022https://github.com/microsoft/TypeScript/issues/51339#issuecomment-1331135760
playground reproducing the issuehttps://www.typescriptlang.org/play?ts=4.9.3#code/FAMwrgdgxgLglgewgAhgUwM4wGKSgJgB4AVZNAD3QgBMNkBvAXwD4AKBAIwCsAuZAJTRQEAJ2qEA1mgCeCEMmIAaZFhFwIAc2QAfBqkww+q9VpYBKBsGTIA8tyEwAdFOkZ23M45CiAogEMoAAtWVhcLAF5mS2trYQgsZE4uADU-ABswNGRwxO4AbRdkPzoXOVRpAAc0MqSAXWArGLh5VhhK6vkk1Iys8L7kAHJjTQGLemQAegnkOISu9My+QWExSRkypRUYNU0dBnQsI22TAG4WAvX5YnqYmNmENLRHNIQNdxSFtAspmaQ57m6iy2Ow0jVuIjQMDAIggYOQjAat3uj2er3egK+k2msxguQ+PT49AOhmBpwRcOayFYA2JA2Q6jxGLGWN+8Vx8wJAiEonEpSuymGWl0RIMRxBZ2YF1kV1qyB8-H4Nn4fFYxHag0FdLgdAgCFxxQwcA0ED8HEeqAQ5SqgySDgGjjMcNifweTxebw5mW+2L+7IBn0JxLFZKdyAhUJhcIR1kYjoRQA
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
Backloghttps://github.com/microsoft/TypeScript/milestone/29
on Nov 10, 2026https://github.com/microsoft/TypeScript/issues/51339#event-35710585504
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
Help Wantedhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Help%20Wanted%22
on Nov 10, 2026https://github.com/microsoft/TypeScript/issues/51339#event-35721421264
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoft/TypeScript/issues/51339
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/51339
Experience Enhancementhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Experience%20Enhancement%22
Suggestionhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
BacklogNo due datehttps://github.com/microsoft/TypeScript/milestone/29
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

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.