René's URL Explorer Experiment


Title: Incorrect circularity detection · Issue #33191 · microsoft/TypeScript · GitHub

Open Graph Title: Incorrect circularity detection · Issue #33191 · microsoft/TypeScript

X Title: Incorrect circularity detection · Issue #33191 · microsoft/TypeScript

Description: TypeScript Version: 3.6.2 Search Terms: 7022 directly or indirectly in its own initializer Code function extent(nums: number[]) { let result: [number, number] | null = null; for (const num of nums) { if (!result) { result = [num, num]; }...

Open Graph Description: TypeScript Version: 3.6.2 Search Terms: 7022 directly or indirectly in its own initializer Code function extent(nums: number[]) { let result: [number, number] | null = null; for (const num of nums)...

X Description: TypeScript Version: 3.6.2 Search Terms: 7022 directly or indirectly in its own initializer Code function extent(nums: number[]) { let result: [number, number] | null = null; for (const num of nums)...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Incorrect circularity detection","articleBody":"**TypeScript Version:**  3.6.2\r\n\r\n**Search Terms:**\r\n\r\n- 7022\r\n- directly or indirectly in its own initializer\r\n\r\n**Code**\r\n\r\n```ts\r\nfunction extent(nums: number[]) {\r\n  let result: [number, number] | null = null;\r\n  for (const num of nums) {\r\n    if (!result) {\r\n      result = [num, num];\r\n    } else {\r\n      const [oldMin, oldMax] = result;\r\n      result = [Math.min(num, oldMin), Math.max(num, oldMax)];\r\n    }\r\n  }\r\n  return result;\r\n}\r\n```\r\n\r\n**Expected behavior:**\r\n\r\nNo error.\r\n\r\n**Actual behavior:**\r\n\r\n```\r\n'oldMin' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.ts(7022)\r\n'oldMax' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.ts(7022)\r\n```\r\n\r\nI'm really struggling to see where the circularity comes in. The type of `result` is shown as `[number, number]` in that branch, so I'd assume destructuring it would result in two `number` types.\r\n\r\nRemoving the destructuring and using array accesses is equivalent but produces no error:\r\n\r\n```ts\r\nfunction extent(nums: number[]) {\r\n  let result: [number, number] | null = null;\r\n  for (const num of nums) {\r\n    if (!result) {\r\n      result = [num, num];\r\n    } else {\r\n      result = [Math.min(num, result[0]), Math.max(num, result[1])];  // ok\r\n    }\r\n  }\r\n  return result;\r\n}\r\n```\r\n\r\n**Playground Link:** \u003c!-- A link to a TypeScript Playground \"Share\" link which demonstrates this behavior --> [link][1]\r\n\r\n**Related Issues:** \u003c!-- Did you find other bugs that looked similar? -->\r\n\r\n- https://github.com/microsoft/TypeScript/issues/32950\r\n\r\n[1]: https://typescript-play.js.org/#code/GYVwdgxgLglg9mABAUwB5WWKAKMIC2AzgFyJ74BGyATgNoC6AlIgN4BQiiANslItckIguUUrXJVqAGjIFJ9RAB9ZXLogC8KrgG4OiYHGqJsEBIT7lEcYLKLN2nTjBvYAhAKEj7ex-0HC+TXECGXJ6XV8AXxQuQmRWH0dTMHNEWjguABMAWRgwGQycgENUBU0PAIjfP09AtOyiqAALADp8PNwQqyzcsEYZBua2ks78Ap6SxnDEyL1ZzgEoEGokCpFdWaA","author":{"url":"https://github.com/danvk","@type":"Person","name":"danvk"},"datePublished":"2019-09-02T14:46:05Z","url":"https://github.com/microsoft/TypeScript/issues/33191"}

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:f6eadbb4-4fb4-3ea3-170d-d0c6956020df
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idA5AC:1EC9BC:C37322:FA3779:6B00FF0C
html-safe-nonce0ba62520d08e6a656811ceb0e63b55b7fefebf58aab234cd98d3870ec0e088a2
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNUFDOjFFQzlCQzpDMzczMjI6RkEzNzc5OjZCMDBGRjBDIiwidmlzaXRvcl9pZCI6IjMxMjE2NjkwMjA5MzIxNzc2NzciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac7f70c46215f8f0747ec1930e0e1b35a9271cbc230f1bcf9d0464684bdde383bb
hovercard-subject-tagissue:488224915
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/33191/issue_layout
twitter:imagehttps://opengraph.githubassets.com/20204376c465b62a8b20c1c65a893b893761a5d690f8de0397622f3a0a771d2a/microsoft/TypeScript/issues/33191
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/20204376c465b62a8b20c1c65a893b893761a5d690f8de0397622f3a0a771d2a/microsoft/TypeScript/issues/33191
og:image:altTypeScript Version: 3.6.2 Search Terms: 7022 directly or indirectly in its own initializer Code function extent(nums: number[]) { let result: [number, number] | null = null; for (const num of nums)...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamedanvk
hostnamegithub.com
expected-hostnamegithub.com
Nonecb7fa109eca7d4156c889f474306b0e91336055e9adf8fd4684b61e49094d124
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
release2b59d31a4e44f08b7af67a4b67f8fd0af3befe2a
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/microsoft/TypeScript/issues/33191#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F33191
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%2F33191
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/33191
Reloadhttps://github.com/microsoft/TypeScript/issues/33191
Reloadhttps://github.com/microsoft/TypeScript/issues/33191
microsofthttps://github.com/microsoft
TypeScripthttps://github.com/microsoft/TypeScript
Codehttps://github.com/microsoft/TypeScript
Issues5k (5k)https://github.com/microsoft/TypeScript/issues
Pull requests309 (309)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/33191
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/33191
Incorrect circularity detectionhttps://github.com/microsoft/TypeScript/issues/33191#top
Design LimitationConstraints of the existing architecture prevent this from being fixedhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Design%20Limitation%22
https://github.com/danvk
Dan Vanderkam (danvk)https://github.com/danvk
on Sep 2, 2019https://github.com/microsoft/TypeScript/issues/33191#issue-488224915
linkhttps://typescript-play.js.org/#code/GYVwdgxgLglg9mABAUwB5WWKAKMIC2AzgFyJ74BGyATgNoC6AlIgN4BQiiANslItckIguUUrXJVqAGjIFJ9RAB9ZXLogC8KrgG4OiYHGqJsEBIT7lEcYLKLN2nTjBvYAhAKEj7ex-0HC+TXECGXJ6XV8AXxQuQmRWH0dTMHNEWjguABMAWRgwGQycgENUBU0PAIjfP09AtOyiqAALADp8PNwQqyzcsEYZBua2ks78Ap6SxnDEyL1ZzgEoEGokCpFdWaA
Circular reference misdetection #32950https://github.com/microsoft/TypeScript/issues/32950
Nathan Shively-Sanders (sandersn)https://github.com/sandersn
BugA bug in TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Bug%22
on Sep 3, 2019https://github.com/microsoft/TypeScript/issues/33191#event-2605144869
Nathan Shively-Sanders (sandersn)https://github.com/sandersn
Backloghttps://github.com/microsoft/TypeScript/milestone/29
on Sep 3, 2019https://github.com/microsoft/TypeScript/issues/33191#event-2605144949
https://github.com/mprobst
Martin Probst (mprobst)https://github.com/mprobst
on Oct 21, 2019https://github.com/microsoft/TypeScript/issues/33191#issuecomment-544496423
https://github.com/s0
Sam Lanning (s0)https://github.com/s0
on Mar 14, 2020https://github.com/microsoft/TypeScript/issues/33191#issuecomment-599053301
https://github.com/JoostK
Joost Koehoorn (JoostK)https://github.com/JoostK
on Jan 27, 2021https://github.com/microsoft/TypeScript/issues/33191#issuecomment-768406687
Playground linkhttps://www.typescriptlang.org/play?ts=4.2.0-beta#code/JYOwLgpgTgZghgYwgAgHIHsAmKDeAoZZECADzAC40sUAfIgVwBtGBuPAXzzxnpATGDoQySAGcwAChDVKGbAEpk+QowhhkCelCgRwciLOrI6IJo2QBeItTaEA7gAtgq5BM3bdYfcgCEFq6bMisqEGkLiRKReRlbuOnrUAHTEZLahcZ7eAVH6aZycQA
https://github.com/tonivj5
Toni Villena (tonivj5)https://github.com/tonivj5
on Jan 27, 2021https://github.com/microsoft/TypeScript/issues/33191#issuecomment-768433379
Joost Koehoorn (@JoostK)https://github.com/JoostK
https://github.com/JoostK
Joost Koehoorn (JoostK)https://github.com/JoostK
on Jan 27, 2021https://github.com/microsoft/TypeScript/issues/33191#issuecomment-768440315
Joost Koehoorn (@JoostK)https://github.com/JoostK
https://github.com/MichaelMitchell-at
michaelm (MichaelMitchell-at)https://github.com/MichaelMitchell-at
on Apr 14, 2022https://github.com/microsoft/TypeScript/issues/33191#issuecomment-1099672432
#48708https://github.com/microsoft/TypeScript/issues/48708
https://github.com/vassudanagunta
Vas Sudanagunta (vassudanagunta)https://github.com/vassudanagunta
on Jun 26, 2023https://github.com/microsoft/TypeScript/issues/33191#issuecomment-1608396957
Playground linkhttps://www.typescriptlang.org/play#code/GYVwdgxgLglg9mABAUwB5WWKB5MyAUYIAtgM4BciRxARsgE4DaAugJSIDeAUIogDbIoieslIg+USo2p16AGiolZzRAB9FfPogC8GvgG4e-QYjh8AJgFkYYBWasBDVId7A49RPggJSQ6qeBFMnZuXl4YQPwAQhExCRCjMOFRcSFdaRIFamYXMIBfFD5SZE5EsMZ7a1tTC0snFV1Y1NykpokdREY6qAALADpiG0JMmqsbVgVu-uInYeI7WqdWHLK8ozXeESgQeiQ2qEM1rlBIWAQUdEwoABUAdzg5iiDZFgTwyOpSPoEwAHNenTaXQABjeYS2OyQRE06yMAiE+ykMgYWSUDAanU+jGBzFRZGxzBWrncnm8YF8QQCQVIYPenhiKXipSSm0ZaUxI2yLUQBWQRRKoRZZIpFVqNgWjlQGP23NZcXZXQcvQGQ2oEqqE0QUwGszVozqqGW3I2PKMEN2yXlhy4QA
https://github.com/danvk
Dan Vanderkam (danvk)https://github.com/danvk
on Feb 28, 2024https://github.com/microsoft/TypeScript/issues/33191#issuecomment-1969602480
Babak K. Shandiz (@babakks)https://github.com/babakks
#56753https://github.com/microsoft/TypeScript/pull/56753
already workshttps://www.typescriptlang.org/play?ts=5.4.0-beta#code/GYVwdgxgLglg9mABAUwB5WWKAKMIC2AzgFyJ74BGyATgNoC6AlIgN4BQiiANslItckIguUUrXJVqAGjIFJ9RAB9ZXLogC8KrgG4OiYHGqJsEBIT7lEcYLKLN2nTjBvYAhAKEj7ex-0HC+TXECGXJ6XV8AXxQuQmRWH0dTMHNEWjguABMAWRgwGQycgENUBU0PAIjfP09AtOyiqAALADp8PNwQqyzcsEYZBua2ks78Ap6SxnDEyL1ZzgEoEGokCpFdWaA
Dan Vanderkam (danvk)https://github.com/danvk
completedhttps://github.com/microsoft/TypeScript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Feb 28, 2024https://github.com/microsoft/TypeScript/issues/33191#event-11955757177
https://github.com/JoostK
Joost Koehoorn (JoostK)https://github.com/JoostK
on Feb 28, 2024https://github.com/microsoft/TypeScript/issues/33191#issuecomment-1969726592
#33191 (comment)https://github.com/microsoft/TypeScript/issues/33191#issuecomment-768406687
#33191https://github.com/microsoft/TypeScript/issues/33191
#42529 (comment)https://github.com/microsoft/TypeScript/issues/42529#issuecomment-769313907
https://github.com/danvk
Dan Vanderkam (danvk)https://github.com/danvk
on Feb 28, 2024https://github.com/microsoft/TypeScript/issues/33191#issuecomment-1969734611
Joost Koehoorn (@JoostK)https://github.com/JoostK
#33191 (comment)https://github.com/microsoft/TypeScript/issues/33191#issuecomment-768406687
https://github.com/RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
on Feb 28, 2024https://github.com/microsoft/TypeScript/issues/33191#issuecomment-1969952438
https://github.com/danvk
Dan Vanderkam (danvk)https://github.com/danvk
on Feb 28, 2024https://github.com/microsoft/TypeScript/issues/33191#issuecomment-1969958665
https://github.com/RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
on Feb 28, 2024https://github.com/microsoft/TypeScript/issues/33191#issuecomment-1969982232
#45213https://github.com/microsoft/TypeScript/issues/45213
https://github.com/babakks
Babak K. Shandiz (babakks)https://github.com/babakks
on Feb 29, 2024https://github.com/microsoft/TypeScript/issues/33191#issuecomment-1970896209
Dan Vanderkam (@danvk)https://github.com/danvk
https://github.com/ahejlsberg
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
on Jul 9, 2024https://github.com/microsoft/TypeScript/issues/33191#issuecomment-2218027441
Ryan Cavanaugh (@RyanCavanaugh)https://github.com/RyanCavanaugh
herehttps://github.com/microsoft/TypeScript/issues/33191#issuecomment-1969952438
#56753https://github.com/microsoft/TypeScript/pull/56753
#59183https://github.com/microsoft/TypeScript/pull/59183
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
Design LimitationConstraints of the existing architecture prevent this from being fixedhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Design%20Limitation%22
BugA bug in TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Bug%22
on Jul 9, 2024https://github.com/microsoft/TypeScript/issues/33191#event-13442360347
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
Backloghttps://github.com/microsoft/TypeScript/milestone/29
on Jul 9, 2024https://github.com/microsoft/TypeScript/issues/33191#event-13442361969
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoft/TypeScript/issues/33191
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/33191
Design LimitationConstraints of the existing architecture prevent this from being fixedhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Design%20Limitation%22
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.