René's URL Explorer Experiment


Title: Improve type inference of `Result` by henrymercer · Pull Request #3506 · github/codeql-action · GitHub

Open Graph Title: Improve type inference of `Result` by henrymercer · Pull Request #3506 · github/codeql-action

X Title: Improve type inference of `Result` by henrymercer · Pull Request #3506 · github/codeql-action

Description: Thanks @mbg for pointing out this drawback. By defining Result as a sum type Success | Failure, we can now infer that a Result is a failure if it is not a success. For example, if we have: const a = new Success(2) as Result; if (a.isSuccess()) { logger.info(`Success with value ${a.value}`); } else { logger.info(`Failure with error ${a.value}`); } we can now infer in the else branch that a.value must be a string.

Open Graph Description: Thanks @mbg for pointing out this drawback. By defining Result<T, E> as a sum type Success<T> | Failure<E>, we can now infer that a Result is a failure if it is not a success. Fo...

X Description: Thanks @mbg for pointing out this drawback. By defining Result&lt;T, E&gt; as a sum type Success&lt;T&gt; | Failure&lt;E&gt;, we can now infer that a Result is a failure if ...

Opengraph URL: https://github.com/github/codeql-action/pull/3506

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:153a5239-338e-c84a-ff91-c3c09978da6d
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id816E:78281:AE1BF8:FB278F:6A4CBBA2
html-safe-nonce19dfc81c5d82e42336e42cd02332a88b7c59ae56e30fc5649af1ef993d80062f
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MTZFOjc4MjgxOkFFMUJGODpGQjI3OEY6NkE0Q0JCQTIiLCJ2aXNpdG9yX2lkIjoiMzc4MzU1MTIxMzgzNzc5NDIxMCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac85e193470492f29fea9d689e8ac3673267e988e3fce00d308d13ff8cae27c1fe
hovercard-subject-tagpull_request:3321889559
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/github/codeql-action/pull/3506/files
twitter:imagehttps://avatars.githubusercontent.com/u/14129055?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/14129055?s=400&v=4
og:image:altThanks @mbg for pointing out this drawback. By defining Result<T, E> as a sum type Success<T> | Failure<E>, we can now infer that a Result is a failure if it is not a success. Fo...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None3d11bb817438277de2a940854450e83a7d32b6aeb5014e9e6b00a6423900251c
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/github/codeql-action git https://github.com/github/codeql-action.git
octolytics-dimension-user_id9919
octolytics-dimension-user_logingithub
octolytics-dimension-repository_id259445878
octolytics-dimension-repository_nwogithub/codeql-action
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id259445878
octolytics-dimension-repository_network_root_nwogithub/codeql-action
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releaseae90d426644ca15e89bacceb72e51f4e9dbf85f7
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/github/codeql-action/pull/3506/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgithub%2Fcodeql-action%2Fpull%2F3506%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
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
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://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/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgithub%2Fcodeql-action%2Fpull%2F3506%2Ffiles
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=github%2Fcodeql-action
Reloadhttps://github.com/github/codeql-action/pull/3506/files
Reloadhttps://github.com/github/codeql-action/pull/3506/files
Reloadhttps://github.com/github/codeql-action/pull/3506/files
Please reload this pagehttps://github.com/github/codeql-action/pull/3506/files
github https://github.com/github
codeql-actionhttps://github.com/github/codeql-action
Notifications https://github.com/login?return_to=%2Fgithub%2Fcodeql-action
Fork 470 https://github.com/login?return_to=%2Fgithub%2Fcodeql-action
Star 1.6k https://github.com/login?return_to=%2Fgithub%2Fcodeql-action
Code https://github.com/github/codeql-action
Issues 156 https://github.com/github/codeql-action/issues
Pull requests 27 https://github.com/github/codeql-action/pulls
Actions https://github.com/github/codeql-action/actions
Models https://github.com/github/codeql-action/models
Security and quality 2 https://github.com/github/codeql-action/security
Insights https://github.com/github/codeql-action/pulse
Code https://github.com/github/codeql-action
Issues https://github.com/github/codeql-action/issues
Pull requests https://github.com/github/codeql-action/pulls
Actions https://github.com/github/codeql-action/actions
Models https://github.com/github/codeql-action/models
Security and quality https://github.com/github/codeql-action/security
Insights https://github.com/github/codeql-action/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fgithub%2Fcodeql-action%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fgithub%2Fcodeql-action%2Fissues%2Fnew%2Fchoose
henrymercerhttps://github.com/henrymercer
mainhttps://github.com/github/codeql-action/tree/main
henrymercer/result-better-inferencehttps://github.com/github/codeql-action/tree/henrymercer/result-better-inference
Conversation 5 https://github.com/github/codeql-action/pull/3506
Findings https://github.com/github/codeql-action/pull/3506/findings
Commits 3 https://github.com/github/codeql-action/pull/3506/commits
Checks 244 https://github.com/github/codeql-action/pull/3506/checks
Files changed https://github.com/github/codeql-action/pull/3506/files
Please reload this pagehttps://github.com/github/codeql-action/pull/3506/files
Improve type inference of Result https://github.com/github/codeql-action/pull/3506/files#top
Show all changes 3 commits https://github.com/github/codeql-action/pull/3506/files
160d27b Improve type inference of `Result` henrymercer Feb 24, 2026 https://github.com/github/codeql-action/pull/3506/commits/160d27baf00e1b1f48bd189d637609258cad98c8
e51b6a9 Update names in tests henrymercer Feb 24, 2026 https://github.com/github/codeql-action/pull/3506/commits/e51b6a9a520cc75c12cc3a2eaef8363f6845b5be
2a607fe Update JSDoc henrymercer Feb 24, 2026 https://github.com/github/codeql-action/pull/3506/commits/2a607fea25af475c1da15fbb12d33701cdf05d16
Clear filters https://github.com/github/codeql-action/pull/3506/files
Please reload this pagehttps://github.com/github/codeql-action/pull/3506/files
Please reload this pagehttps://github.com/github/codeql-action/pull/3506/files
init-action.js https://github.com/github/codeql-action/pull/3506/files#diff-bd9b22d62f144e71ae32a07c7c5151e30b31cd76d22303745df64c9886d81342
init-action.ts https://github.com/github/codeql-action/pull/3506/files#diff-87bf9e0a2a9244ba1f26eb01d404deaccbc9580479d2e2530a4ff2fd5bd91565
util.test.ts https://github.com/github/codeql-action/pull/3506/files#diff-5b8db3845646ec2fda6f1a8fb2b5b8c67460b5070568f4be6320f344704969cd
util.ts https://github.com/github/codeql-action/pull/3506/files#diff-3294a832ea2276e554177e0b3007cc2d401c082912c7fbde49fa09141bf1aed1
https://github.com/github/codeql-action/blob/main/CODEOWNERS#L1
lib/init-action.jshttps://github.com/github/codeql-action/pull/3506/files#diff-bd9b22d62f144e71ae32a07c7c5151e30b31cd76d22303745df64c9886d81342
View file https://github.com/github/codeql-action/blob/2a607fea25af475c1da15fbb12d33701cdf05d16/lib/init-action.js
Open in desktop https://desktop.github.com
how customized files appear on GitHubhttps://docs.github.com/github/administering-a-repository/customizing-how-changed-files-appear-on-github
Please reload this pagehttps://github.com/github/codeql-action/pull/3506/files
https://github.com/github/codeql-action/blob/main/CODEOWNERS#L1
src/init-action.tshttps://github.com/github/codeql-action/pull/3506/files#diff-87bf9e0a2a9244ba1f26eb01d404deaccbc9580479d2e2530a4ff2fd5bd91565
View file https://github.com/github/codeql-action/blob/2a607fea25af475c1da15fbb12d33701cdf05d16/src/init-action.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/github/codeql-action/pull/3506/{{ revealButtonHref }}
https://github.com/github/codeql-action/pull/3506/files#diff-87bf9e0a2a9244ba1f26eb01d404deaccbc9580479d2e2530a4ff2fd5bd91565
https://github.com/github/codeql-action/pull/3506/files#diff-87bf9e0a2a9244ba1f26eb01d404deaccbc9580479d2e2530a4ff2fd5bd91565
https://github.com/github/codeql-action/pull/3506/files#diff-87bf9e0a2a9244ba1f26eb01d404deaccbc9580479d2e2530a4ff2fd5bd91565
https://github.com/github/codeql-action/pull/3506/files#diff-87bf9e0a2a9244ba1f26eb01d404deaccbc9580479d2e2530a4ff2fd5bd91565
https://github.com/github/codeql-action/blob/main/CODEOWNERS#L1
src/util.test.tshttps://github.com/github/codeql-action/pull/3506/files#diff-5b8db3845646ec2fda6f1a8fb2b5b8c67460b5070568f4be6320f344704969cd
View file https://github.com/github/codeql-action/blob/2a607fea25af475c1da15fbb12d33701cdf05d16/src/util.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/github/codeql-action/pull/3506/{{ revealButtonHref }}
https://github.com/github/codeql-action/pull/3506/files#diff-5b8db3845646ec2fda6f1a8fb2b5b8c67460b5070568f4be6320f344704969cd
https://github.com/github/codeql-action/blob/main/CODEOWNERS#L1
src/util.tshttps://github.com/github/codeql-action/pull/3506/files#diff-3294a832ea2276e554177e0b3007cc2d401c082912c7fbde49fa09141bf1aed1
View file https://github.com/github/codeql-action/blob/2a607fea25af475c1da15fbb12d33701cdf05d16/src/util.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/github/codeql-action/pull/3506/{{ revealButtonHref }}
https://github.com/github/codeql-action/pull/3506/files#diff-3294a832ea2276e554177e0b3007cc2d401c082912c7fbde49fa09141bf1aed1
Please reload this pagehttps://github.com/github/codeql-action/pull/3506/files
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.