René's URL Explorer Experiment


Title: In JSDoc, `?` of conditional is frequently parsed as postfix-`?` · Issue #27424 · microsoft/TypeScript · GitHub

Open Graph Title: In JSDoc, `?` of conditional is frequently parsed as postfix-`?` · Issue #27424 · microsoft/TypeScript

X Title: In JSDoc, `?` of conditional is frequently parsed as postfix-`?` · Issue #27424 · microsoft/TypeScript

Description: TypeScript Version: 3.2.0-dev.20180927 Search Terms: JSDoc conditional types Using Conditional Types in JSDoc comments confuses the TypeScript parser since the T extends Y ? A : B syntax looks similar to the Y? (meaning Y|null) syntax fr...

Open Graph Description: TypeScript Version: 3.2.0-dev.20180927 Search Terms: JSDoc conditional types Using Conditional Types in JSDoc comments confuses the TypeScript parser since the T extends Y ? A : B syntax looks simi...

X Description: TypeScript Version: 3.2.0-dev.20180927 Search Terms: JSDoc conditional types Using Conditional Types in JSDoc comments confuses the TypeScript parser since the T extends Y ? A : B syntax looks simi...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"In JSDoc, `?` of conditional is frequently parsed as postfix-`?`","articleBody":"**TypeScript Version:**  3.2.0-dev.20180927\r\n**Search Terms:** JSDoc conditional types\r\n\r\nUsing [Conditional Types](https://www.typescriptlang.org/docs/handbook/advanced-types.html#conditional-types) in JSDoc comments confuses the TypeScript parser since the `T extends Y ? A : B` syntax looks similar to the `Y?` (meaning `Y|null`) syntax from JSDoc.\r\n\r\n**Code**\r\n\r\n```js\r\n/**\r\n * @template {{}} T\r\n * @param {T} o\r\n * @returns {T extends Readonly\u003cinfer U> ? (keyof U)[] : string[]}\r\n */\r\nfunction Object_keys(o) {\r\n\tlet keys = Object.keys(o);\r\n\t// @ts-ignore: Type assertion for stripping `Readonly\u003c…>`\r\n\treturn keys;\r\n}\r\n```\r\n\r\n**Expected behavior:**\r\n\r\nNo error should be reported.\r\nThe type of `Object_keys` should be: `\u003cT extends {}>(o: T): T extends Readonly\u003cinfer U> ? (keyof U)[] : string[]`.\r\n\r\n**Actual behavior:**\r\n\r\nTypeScript compiler shows an error (*\"?\" expected*) and mistakes the existing `?` operator for JSDoc `\u003ctype>|null` syntax.\r\n\r\nThe actual type therefor ends up being: `\u003cT extends {}>(o: T): T extends Readonly\u003cinfer U> | null ? (keyof U)[] : string[]`.\r\n\r\n**Possible fixes:**\r\n\r\n 1. When encountering a top-level (not within parenthesis) `?` token in an extends clause, scan ahead and check whether it is followed by an `|` or `&` token (type intersection or union operators). If yes, treat it as `|null` and keep processing; otherwise, assume it's the start of a conditional type declaration. (Requires at least an LF(2) parser.)\r\n  2. Prohibit the JSDoc `?` operator in the top-level of an extends clause, always causing it to be treated as the start of the conditional type declaration.\r\n\r\n**Playground Link:** None, Playground does not seem to support JavaScript with JSDoc instead of TypeScript as input.","author":{"url":"https://github.com/ntninja","@type":"Person","name":"ntninja"},"datePublished":"2018-09-28T11:24:57Z","url":"https://github.com/microsoft/TypeScript/issues/27424"}

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:b709c152-f883-875d-543d-8fe2d3d06169
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idAF46:14ECB:A16FBD:CEDB9E:6B00F23E
html-safe-nonce8c24d33a232a772f4155d68671997cb06e7f2648b4ce832d5b82df1aa3f4f99e
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRjQ2OjE0RUNCOkExNkZCRDpDRURCOUU6NkIwMEYyM0UiLCJ2aXNpdG9yX2lkIjoiMTg3NjE1ODcxNzUyNTY2MzgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac5f1d727d790db02ee8527fcdc6106e319b25b5da0941d90277c47385fde23eac
hovercard-subject-tagissue:364849439
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/27424/issue_layout
twitter:imagehttps://opengraph.githubassets.com/6e74e8a0fb0d232ec126dbba7605854ae8d3b9d66772226122721ced69464d71/microsoft/TypeScript/issues/27424
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/6e74e8a0fb0d232ec126dbba7605854ae8d3b9d66772226122721ced69464d71/microsoft/TypeScript/issues/27424
og:image:altTypeScript Version: 3.2.0-dev.20180927 Search Terms: JSDoc conditional types Using Conditional Types in JSDoc comments confuses the TypeScript parser since the T extends Y ? A : B syntax looks simi...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamentninja
hostnamegithub.com
expected-hostnamegithub.com
None4ef498cbabcbe3c50befc7a5b743e7072ee770b4daf0e15e54801180d1fa91fc
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
release9983dd5da06943f833c971dd5b6bc988e2858be5
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/microsoft/TypeScript/issues/27424#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F27424
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%2F27424
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/27424
Reloadhttps://github.com/microsoft/TypeScript/issues/27424
Reloadhttps://github.com/microsoft/TypeScript/issues/27424
microsofthttps://github.com/microsoft
TypeScripthttps://github.com/microsoft/TypeScript
Codehttps://github.com/microsoft/TypeScript
Issues5k (5k)https://github.com/microsoft/TypeScript/issues
Pull requests308 (308)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/27424
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/27424
In JSDoc, ? of conditional is frequently parsed as postfix-?https://github.com/microsoft/TypeScript/issues/27424#top
BugA bug in TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Bug%22
Domain: JSDocRelates to JSDoc parsing and type generationhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Domain%3A%20JSDoc%22
Backloghttps://github.com/microsoft/TypeScript/milestone/29
https://github.com/ntninja
Erin of Yukis (ntninja)https://github.com/ntninja
on Sep 28, 2018https://github.com/microsoft/TypeScript/issues/27424#issue-364849439
Conditional Typeshttps://www.typescriptlang.org/docs/handbook/advanced-types.html#conditional-types
Erin of Yukis (ntninja)https://github.com/ntninja
on Sep 28, 2018https://github.com/microsoft/TypeScript/issues/27424#event-1873285844
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
BugA bug in TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Bug%22
on Sep 28, 2018https://github.com/microsoft/TypeScript/issues/27424#event-1873882991
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
Nathan Shively-Sanders (sandersn)https://github.com/sandersn
on Sep 28, 2018https://github.com/microsoft/TypeScript/issues/27424#event-1873883317
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
TypeScript 3.2https://github.com/microsoft/TypeScript/milestone/77
on Sep 28, 2018https://github.com/microsoft/TypeScript/issues/27424#event-1873883492
https://github.com/sandersn
Nathan Shively-Sanders (sandersn)https://github.com/sandersn
on Sep 28, 2018https://github.com/microsoft/TypeScript/issues/27424#issuecomment-425483314
Daniel Rosenwasser (DanielRosenwasser)https://github.com/DanielRosenwasser
TypeScript 3.2https://github.com/microsoft/TypeScript/milestone/77
TypeScript 3.3https://github.com/microsoft/TypeScript/milestone/79
on Oct 30, 2018https://github.com/microsoft/TypeScript/issues/27424#event-1936512753
Nathan Shively-Sanders (sandersn)https://github.com/sandersn
TypeScript 3.3https://github.com/microsoft/TypeScript/milestone/79
TypeScript 3.4.0https://github.com/microsoft/TypeScript/milestone/86
on Jan 16, 2019https://github.com/microsoft/TypeScript/issues/27424#event-2078528677
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
TypeScript 3.4.0https://github.com/microsoft/TypeScript/milestone/86
TypeScript 3.5.0https://github.com/microsoft/TypeScript/milestone/89
on Mar 14, 2019https://github.com/microsoft/TypeScript/issues/27424#event-2202139313
https://github.com/noinkling
Malcolm (noinkling)https://github.com/noinkling
on Apr 28, 2019https://github.com/microsoft/TypeScript/issues/27424#issuecomment-487371615
https://github.com/sandersn
Nathan Shively-Sanders (sandersn)https://github.com/sandersn
on May 20, 2019https://github.com/microsoft/TypeScript/issues/27424#issuecomment-494085594
Nathan Shively-Sanders (sandersn)https://github.com/sandersn
on May 20, 2019https://github.com/microsoft/TypeScript/issues/27424#event-2353857785
Nathan Shively-Sanders (sandersn)https://github.com/sandersn
TypeScript 3.5.0https://github.com/microsoft/TypeScript/milestone/89
Backloghttps://github.com/microsoft/TypeScript/milestone/29
on May 20, 2019https://github.com/microsoft/TypeScript/issues/27424#event-2353858067
https://github.com/brendankenny
Brendan Kenny (brendankenny)https://github.com/brendankenny
on May 20, 2019https://github.com/microsoft/TypeScript/issues/27424#issuecomment-494092606
https://github.com/goodmind
andretshurotshka (goodmind)https://github.com/goodmind
on Jun 15, 2019https://github.com/microsoft/TypeScript/issues/27424#issuecomment-502396450
Nathan Shively-Sanders (sandersn)https://github.com/sandersn
on Jan 7, 2020https://github.com/microsoft/TypeScript/issues/27424#event-2929382382
https://github.com/ExE-Boss
ExE Boss (ExE-Boss)https://github.com/ExE-Boss
on Jul 27, 2020https://github.com/microsoft/TypeScript/issues/27424#issuecomment-664547549
https://github.com/sandersn
Nathan Shively-Sanders (sandersn)https://github.com/sandersn
on Jul 28, 2020https://github.com/microsoft/TypeScript/issues/27424#issuecomment-665111207
#39123https://github.com/microsoft/TypeScript/pull/39123
ExE Boss (@ExE-Boss)https://github.com/ExE-Boss
https://github.com/ExE-Boss
ExE Boss (ExE-Boss)https://github.com/ExE-Boss
on Jul 28, 2020https://github.com/microsoft/TypeScript/issues/27424#issuecomment-665138724
https://github.com/sandersn
Nathan Shively-Sanders (sandersn)https://github.com/sandersn
on Jul 28, 2020https://github.com/microsoft/TypeScript/issues/27424#issuecomment-665238326
https://github.com/ExE-Boss
ExE Boss (ExE-Boss)https://github.com/ExE-Boss
on Jul 29, 2020https://github.com/microsoft/TypeScript/issues/27424#issuecomment-665599412
https://github.com/sandersn
Nathan Shively-Sanders (sandersn)https://github.com/sandersn
on Jul 29, 2020https://github.com/microsoft/TypeScript/issues/27424#issuecomment-665977372
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
Domain: JSDocRelates to JSDoc parsing and type generationhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Domain%3A%20JSDoc%22
on Oct 16, 2025https://github.com/microsoft/TypeScript/issues/27424#event-20330936045
https://github.com/RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
on Oct 29, 2025https://github.com/microsoft/TypeScript/issues/27424#issuecomment-3464750403
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
completedhttps://github.com/microsoft/TypeScript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Oct 29, 2025https://github.com/microsoft/TypeScript/issues/27424#event-20593857835
microsofthttps://github.com/microsoft
on May 27, 2026https://github.com/microsoft/TypeScript/issues/27424#event-26025631125
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoft/TypeScript/issues/27424
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/27424
BugA bug in TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Bug%22
Domain: JSDocRelates to JSDoc parsing and type generationhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Domain%3A%20JSDoc%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.