René's URL Explorer Experiment


Title: Aliases are lost when conditionals are applied · Issue #61581 · microsoft/TypeScript · GitHub

Open Graph Title: Aliases are lost when conditionals are applied · Issue #61581 · microsoft/TypeScript

X Title: Aliases are lost when conditionals are applied · Issue #61581 · microsoft/TypeScript

Description: 🔎 Search Terms aliases lost 🕗 Version & Regression Information Discussion with Mateusz Burzyński (@Andarist): TypeFormatFlags.InTypeAlias is at fault here, it's rather hard to track its exact conceptual purpose. And it has been there for...

Open Graph Description: 🔎 Search Terms aliases lost 🕗 Version & Regression Information Discussion with Mateusz Burzyński (@Andarist): TypeFormatFlags.InTypeAlias is at fault here, it's rather hard to track its exact conce...

X Description: 🔎 Search Terms aliases lost 🕗 Version & Regression Information Discussion with Mateusz Burzyński (@Andarist): TypeFormatFlags.InTypeAlias is at fault here, it's rather hard to track its exa...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Aliases are lost when conditionals are applied","articleBody":"### 🔎 Search Terms\n\naliases lost\n\n### 🕗 Version & Regression Information\n\nDiscussion with @Andarist:\n\n- TypeFormatFlags.InTypeAlias is at fault here, it's rather hard to track its exact conceptual purpose. And it has been there forever - I found commits with it from 9 years ago\n- I briefly thought this might be related to ur issue: https://github.com/microsoft/TypeScript/issues/43031\nbut now I'm pretty sure it isn't\n- but it's also a somewhat funny issue because it complains about an alias for a union being lost and it was broken by a PR that... introduces improved union/intersection aliasing 😄 https://github.com/microsoft/TypeScript/pull/42149 , there was also a quick follow up to this PR that feels slightly related: https://github.com/microsoft/TypeScript/pull/42284\n\nAnyway, I'm sort of leaving breadcrumbs for myself - sorry for oversharing 😉  I'll dig further later\n\n### ⏯ Playground Link\n\nhttps://www.typescriptlang.org/play/?#code/C4TwDgpgBAShDOBXANsAPAQQDRQKID4oBeKAbwCgoqoAnCAQwBMB7AO2RCgH1h6BzAFxQARAHkA1sMrU6TNhygA3eskQQhGcgF8oAHzLSqslu049+Q4QDF6AS2RTqtBiYUQaNZjSG5t5cowQAMbI9HRQQWzwwFC28HBIqEIAFIhCiKzirMwA7qwAlMSEiLHwsAgo6PSsIDjVIPj+kazRUABmrMRQmDgEybasYEIJlT14hPrRNAN8hUSEcSOo-YOFAPyxg1CWzJJAA\n\n### 💻 Code\n\n```ts\ntype Result\u003cA, E> = {\n    readonly _tag: \"Ok\"\n    readonly value: A\n} | {\n    readonly _tag: \"Fail\"\n    readonly error: E\n}\n\ndeclare const isResult: (u: unknown) => u is Result\u003cany, any>\n\nconst fn = \u003cA, E>(inp: Result\u003cA, E> | string) => isResult(inp) ? inp : \"ok\"\n```\n\n\n### 🙁 Actual behavior\n\n```ts\nconst fn: \u003cA, E>(inp: Result\u003cA, E> | string) => {\n    readonly _tag: \"Ok\";\n    readonly value: A;\n} | {\n    readonly _tag: \"Fail\";\n    readonly error: E;\n} | \"ok\"\n```\n\n### 🙂 Expected behavior\n\n```ts\nconst fn: \u003cA, E>(inp: Result\u003cA, E> | string) => Result\u003cA, E> | \"ok\"\n```\n\n### Additional information about the issue\n\n_No response_","author":{"url":"https://github.com/mikearnaldi","@type":"Person","name":"mikearnaldi"},"datePublished":"2025-04-15T09:42:31Z","url":"https://github.com/microsoft/TypeScript/issues/61581"}

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:796c7eeb-976f-ad26-6649-ad809ad957ad
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idB542:BB75:7C2349:A3DCCD:6B01AE21
html-safe-noncee8dc78ff2b112f3ed3ff401e533cd7d992bbafc493649aa46dd3545f55afbe0e
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNTQyOkJCNzU6N0MyMzQ5OkEzRENDRDo2QjAxQUUyMSIsInZpc2l0b3JfaWQiOiI2NTk5NDQ1MzcwNjk3MjY0NjczIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac6725916e059bae6cbcccc1724079471ae2394938ebb1f780b28ac08609f0e00f
hovercard-subject-tagissue:2995826887
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/61581/issue_layout
twitter:imagehttps://opengraph.githubassets.com/f91ec21ef4f1927e535acfef2a04250f9b66a97f594befaea220dcf39946b44c/microsoft/TypeScript/issues/61581
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/f91ec21ef4f1927e535acfef2a04250f9b66a97f594befaea220dcf39946b44c/microsoft/TypeScript/issues/61581
og:image:alt🔎 Search Terms aliases lost 🕗 Version & Regression Information Discussion with Mateusz Burzyński (@Andarist): TypeFormatFlags.InTypeAlias is at fault here, it's rather hard to track its exact conce...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamemikearnaldi
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
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
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/microsoft/TypeScript/issues/61581#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F61581
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%2F61581
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/61581
Reloadhttps://github.com/microsoft/TypeScript/issues/61581
Reloadhttps://github.com/microsoft/TypeScript/issues/61581
microsofthttps://github.com/microsoft
TypeScripthttps://github.com/microsoft/TypeScript
Codehttps://github.com/microsoft/TypeScript
Issues5k (5k)https://github.com/microsoft/TypeScript/issues
Pull requests312 (312)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/61581
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/61581
Aliases are lost when conditionals are appliedhttps://github.com/microsoft/TypeScript/issues/61581#top
7.0 LS Migrationhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%227.0%20LS%20Migration%22
Domain: LS: Type DisplayBugs relating to showing types in Quick Info/Tooltips, Signature Help, or Completion Infohttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Domain%3A%20LS%3A%20Type%20Display%22
Possible ImprovementThe current behavior isn't wrong, but it's possible to see that it might be better in some caseshttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Possible%20Improvement%22
Backloghttps://github.com/microsoft/TypeScript/milestone/29
https://github.com/mikearnaldi
Michael Arnaldi (mikearnaldi)https://github.com/mikearnaldi
on Apr 15, 2025https://github.com/microsoft/TypeScript/issues/61581#issue-2995826887
Mateusz Burzyński (@Andarist)https://github.com/Andarist
Type alias printing regressed in TypeScript 4.2.2 #43031https://github.com/microsoft/TypeScript/issues/43031
Preserve type aliases for union and intersection types #42149https://github.com/microsoft/TypeScript/pull/42149
Support re-aliasing of type alias instantiations #42284https://github.com/microsoft/TypeScript/pull/42284
https://www.typescriptlang.org/play/?#code/C4TwDgpgBAShDOBXANsAPAQQDRQKID4oBeKAbwCgoqoAnCAQwBMB7AO2RCgH1h6BzAFxQARAHkA1sMrU6TNhygA3eskQQhGcgF8oAHzLSqslu049+Q4QDF6AS2RTqtBiYUQaNZjSG5t5cowQAMbI9HRQQWzwwFC28HBIqEIAFIhCiKzirMwA7qwAlMSEiLHwsAgo6PSsIDjVIPj+kazRUABmrMRQmDgEybasYEIJlT14hPrRNAN8hUSEcSOo-YOFAPyxg1CWzJJAAhttps://www.typescriptlang.org/play/#code/C4TwDgpgBAShDOBXANsAPAQQDRQKID4oBeKAbwCgoqoAnCAQwBMB7AO2RCgH1h6BzAFxQARAHkA1sMrU6TNhygA3eskQQhGcgF8oAHzLSqslu049+Q4QDF6AS2RTqtBiYUQaNZjSG5t5cowQAMbI9HRQQWzwwFC28HBIqEIAFIhCiKzirMwA7qwAlMSEiLHwsAgo6PSsIDjVIPj+kazRUABmrMRQmDgEybasYEIJlT14hPrRNAN8hUSEcSOo-YOFAPyxg1CWzJJAA
https://github.com/mikearnaldi
Michael Arnaldi (mikearnaldi)https://github.com/mikearnaldi
on Apr 15, 2025https://github.com/microsoft/TypeScript/issues/61581#issuecomment-2804574755
Mateusz Burzyński (@Andarist)https://github.com/Andarist
https://github.com/Andarist
Mateusz Burzyński (Andarist)https://github.com/Andarist
on Apr 15, 2025https://github.com/microsoft/TypeScript/issues/61581#issuecomment-2804627523
https://github.dev/microsoft/TypeScript/blob/4dc677b292354f4b9162452b2e00f4d7dd118221/src/compiler/checker.ts#L29346-L29365https://github.dev/microsoft/TypeScript/blob/4dc677b292354f4b9162452b2e00f4d7dd118221/src/compiler/checker.ts#L29346-L29365
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
Help Wantedhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Help%20Wanted%22
Possible ImprovementThe current behavior isn't wrong, but it's possible to see that it might be better in some caseshttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Possible%20Improvement%22
on Apr 16, 2025https://github.com/microsoft/TypeScript/issues/61581#event-17282298043
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
Backloghttps://github.com/microsoft/TypeScript/milestone/29
on Apr 16, 2025https://github.com/microsoft/TypeScript/issues/61581#event-17282298311
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
Domain: LS: Type DisplayBugs relating to showing types in Quick Info/Tooltips, Signature Help, or Completion Infohttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Domain%3A%20LS%3A%20Type%20Display%22
on Oct 15, 2025https://github.com/microsoft/TypeScript/issues/61581#event-20306568763
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
7.0 LS Migrationhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%227.0%20LS%20Migration%22
on Dec 2, 2025https://github.com/microsoft/TypeScript/issues/61581#event-21318396024
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
not plannedhttps://github.com/microsoft/TypeScript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Anot-planned
on Dec 3, 2025https://github.com/microsoft/TypeScript/issues/61581#event-21319516373
microsofthttps://github.com/microsoft
on Dec 3, 2025https://github.com/microsoft/TypeScript/issues/61581#event-21319516615
https://github.com/RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
on Dec 3, 2025https://github.com/microsoft/TypeScript/issues/61581#issuecomment-3604518892
#62827https://github.com/microsoft/TypeScript/issues/62827
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoft/TypeScript/issues/61581
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/61581
7.0 LS Migrationhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%227.0%20LS%20Migration%22
Domain: LS: Type DisplayBugs relating to showing types in Quick Info/Tooltips, Signature Help, or Completion Infohttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Domain%3A%20LS%3A%20Type%20Display%22
Possible ImprovementThe current behavior isn't wrong, but it's possible to see that it might be better in some caseshttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Possible%20Improvement%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

Viewport: width=device-width


URLs of crawlers that visited me.