René's URL Explorer Experiment


Title: TS ^4 does not recognize array methods on (T[] | T[][]) as callable · Issue #40157 · microsoft/TypeScript · GitHub

Open Graph Title: TS ^4 does not recognize array methods on (T[] | T[][]) as callable · Issue #40157 · microsoft/TypeScript

X Title: TS ^4 does not recognize array methods on (T[] | T[][]) as callable · Issue #40157 · microsoft/TypeScript

Description: TypeScript Version: 4.0.2, 4.1.0-dev.20200820 Search Terms: union, array methods Code The following example uses every method, but the bug affects all other methods as well (map, reduce, etc.). const a: string[] | string[][] = []; a.ever...

Open Graph Description: TypeScript Version: 4.0.2, 4.1.0-dev.20200820 Search Terms: union, array methods Code The following example uses every method, but the bug affects all other methods as well (map, reduce, etc.). con...

X Description: TypeScript Version: 4.0.2, 4.1.0-dev.20200820 Search Terms: union, array methods Code The following example uses every method, but the bug affects all other methods as well (map, reduce, etc.). con...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"TS ^4 does not recognize array methods on (T[] | T[][]) as callable","articleBody":"**TypeScript Version:**  4.0.2, 4.1.0-dev.20200820\r\n\r\n**Search Terms:** union, array methods\r\n\r\n**Code**\r\n\r\nThe following example uses `every` method, but the bug affects all other methods as well (`map`, `reduce`, etc.).\r\n\r\n```ts\r\nconst a: string[] | string[][] = [];\r\n\r\na.every(b => console.log(b)); // TS-2349: This expression is not callable.\r\n\r\n// Attempt №1: suppress TS-7006\r\na.every((b: string | string[]) => console.log(b)); // TS-2349: This expression is not callable.\r\n\r\n// Attempt №2: rewrite as typeguard (as in https://github.com/microsoft/TypeScript/blob/v4.0-beta/lib/lib.es5.d.ts#L1319)\r\na.every((b: string | string[]): b is string => typeof b === 'string'); // TS-2349: This expression is not callable.\r\n```\r\n\r\n**Expected behavior:** No errors, code should compile.\r\n\r\n**Actual behavior:** Error `TS-2349: This expression is not callable.`\r\n\r\n**Playground Link:** https://www.typescriptlang.org/play?ts=4.1.0-dev.20200819#code/MYewdgzgLgBAhgLhtATgSzAcwNoF0YA+yU6WeeMAvDHgNwBQ9cAdAKYBurKAngBQBGVAHwxQkEABtWzCSEwCAlAoZM2nHrwFJUGTIWKkcuBcNHgIk6bPn8lKlhy58tB3fp1ljSQWgiusplDcAA6sIABmMIKUMTAA5B6Yccr0QA\r\n\r\n**Related Issues:** I didn't find anything similar.\r\n","author":{"url":"https://github.com/dkamyshov","@type":"Person","name":"dkamyshov"},"datePublished":"2020-08-20T17:22:25Z","url":"https://github.com/microsoft/TypeScript/issues/40157"}

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:b9ac3125-92d8-70b7-df5d-25870e69b77c
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idCEFA:2454CC:7CC33D:A05994:6B00E7A5
html-safe-nonceb54e0b53a8b758116f779b5108d6932484944706a0391ae8fc7a31427294b120
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRUZBOjI0NTRDQzo3Q0MzM0Q6QTA1OTk0OjZCMDBFN0E1IiwidmlzaXRvcl9pZCI6IjE2MjE5MTEwNDAxMDkzNzMzNDkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac6a88a0dadf3a027fa3ea9a8ad660de605b14bf6fc75e903b13e8020936939b90
hovercard-subject-tagissue:682937187
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/40157/issue_layout
twitter:imagehttps://opengraph.githubassets.com/0258affa84b33066cef7e11d1c310eeec3f178e45260995577d77473802e22f3/microsoft/TypeScript/issues/40157
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/0258affa84b33066cef7e11d1c310eeec3f178e45260995577d77473802e22f3/microsoft/TypeScript/issues/40157
og:image:altTypeScript Version: 4.0.2, 4.1.0-dev.20200820 Search Terms: union, array methods Code The following example uses every method, but the bug affects all other methods as well (map, reduce, etc.). con...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamedkamyshov
hostnamegithub.com
expected-hostnamegithub.com
None27088b6977484d0d3321d9a11c907c6d6637b315cfa359ef7952dbf6292f9b14
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
release624179fb8b88d26ba5bba08894eb60a1c5a1d93d
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/microsoft/TypeScript/issues/40157#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F40157
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%2F40157
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/40157
Reloadhttps://github.com/microsoft/TypeScript/issues/40157
Reloadhttps://github.com/microsoft/TypeScript/issues/40157
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/40157
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/40157
TS ^4 does not recognize array methods on (T[] | T[][]) as callablehttps://github.com/microsoft/TypeScript/issues/40157#top
https://github.com/weswigham
Breaking ChangeWould introduce errors in existing codehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Breaking%20Change%22
Working as IntendedThe behavior described is the intended behavior; this is not a bughttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Working%20as%20Intended%22
https://github.com/dkamyshov
Danil Kamyshov (dkamyshov)https://github.com/dkamyshov
on Aug 20, 2020https://github.com/microsoft/TypeScript/issues/40157#issue-682937187
https://www.typescriptlang.org/play?ts=4.1.0-dev.20200819#code/MYewdgzgLgBAhgLhtATgSzAcwNoF0YA+yU6WeeMAvDHgNwBQ9cAdAKYBurKAngBQBGVAHwxQkEABtWzCSEwCAlAoZM2nHrwFJUGTIWKkcuBcNHgIk6bPn8lKlhy58tB3fp1ljSQWgiusplDcAA6sIABmMIKUMTAA5B6Yccr0QAhttps://www.typescriptlang.org/play?ts=4.1.0-dev.20200819#code/MYewdgzgLgBAhgLhtATgSzAcwNoF0YA+yU6WeeMAvDHgNwBQ9cAdAKYBurKAngBQBGVAHwxQkEABtWzCSEwCAlAoZM2nHrwFJUGTIWKkcuBcNHgIk6bPn8lKlhy58tB3fp1ljSQWgiusplDcAA6sIABmMIKUMTAA5B6Yccr0QA
https://github.com/dkamyshov
Danil Kamyshov (dkamyshov)https://github.com/dkamyshov
on Aug 20, 2020https://github.com/microsoft/TypeScript/issues/40157#issuecomment-677798457
https://www.typescriptlang.org/play?ts=4.1.0-dev.20200819#code/MYewdgzgLgBAhgLhtATgSzAcwNoF0YA+yU6WeeMAvDHgNwBQ9cAdAKYBurKAngBS8BKKgD4YAbwC+AhvVCRYAIySoMOfERVlcFatjy4ZCtpx78hlUZOmM50GMGUlVFDU606aAcmCeDN41x8giLiUjK2sABmVDC8ACaOpGqExEnkuOaW9DA5MHEBpsEWodYS9EAhttps://www.typescriptlang.org/play?ts=4.1.0-dev.20200819#code/MYewdgzgLgBAhgLhtATgSzAcwNoF0YA+yU6WeeMAvDHgNwBQ9cAdAKYBurKAngBS8BKKgD4YAbwC+AhvVCRYAIySoMOfERVlcFatjy4ZCtpx78hlUZOmM50GMGUlVFDU606aAcmCeDN41x8giLiUjK2sABmVDC8ACaOpGqExEnkuOaW9DA5MHEBpsEWodYS9EA
https://github.com/dkamyshov
Danil Kamyshov (dkamyshov)https://github.com/dkamyshov
on Aug 20, 2020https://github.com/microsoft/TypeScript/issues/40157#issuecomment-677800356
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
Wesley Wigham (weswigham)https://github.com/weswigham
on Aug 20, 2020https://github.com/microsoft/TypeScript/issues/40157#event-3676385841
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
Needs InvestigationThis issue needs a team member to investigate its status.https://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Needs%20Investigation%22
on Aug 20, 2020https://github.com/microsoft/TypeScript/issues/40157#event-3676386157
https://github.com/weswigham
Wesley Wigham (weswigham)https://github.com/weswigham
on Aug 20, 2020https://github.com/microsoft/TypeScript/issues/40157#issuecomment-677840981
#38200https://github.com/microsoft/TypeScript/pull/38200
Wesley Wigham (weswigham)https://github.com/weswigham
Breaking ChangeWould introduce errors in existing codehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Breaking%20Change%22
Working as IntendedThe behavior described is the intended behavior; this is not a bughttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Working%20as%20Intended%22
Needs InvestigationThis issue needs a team member to investigate its status.https://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Needs%20Investigation%22
on Aug 20, 2020https://github.com/microsoft/TypeScript/issues/40157#event-3676685535
https://github.com/weswigham
Wesley Wigham (weswigham)https://github.com/weswigham
on Aug 20, 2020https://github.com/microsoft/TypeScript/issues/40157#issuecomment-677841692
Ryan Cavanaugh (@RyanCavanaugh)https://github.com/RyanCavanaugh
#38200https://github.com/microsoft/TypeScript/pull/38200
https://github.com/pleunv
Pleun Vanderbauwhede (pleunv)https://github.com/pleunv
on Aug 21, 2020https://github.com/microsoft/TypeScript/issues/40157#issuecomment-678109934
https://github.com/dkamyshov
Danil Kamyshov (dkamyshov)https://github.com/dkamyshov
on Aug 21, 2020https://github.com/microsoft/TypeScript/issues/40157#issuecomment-678146429
Pleun Vanderbauwhede (@pleunv)https://github.com/pleunv
https://github.com/typescript-bot
TypeScript Bot (typescript-bot)https://github.com/typescript-bot
on Aug 23, 2020https://github.com/microsoft/TypeScript/issues/40157#issuecomment-678817847
TypeScript Bot (typescript-bot)https://github.com/typescript-bot
completedhttps://github.com/microsoft/TypeScript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Aug 23, 2020https://github.com/microsoft/TypeScript/issues/40157#event-3683095445
microsofthttps://github.com/microsoft
on Oct 21, 2025https://github.com/microsoft/TypeScript/issues/40157#event-20417016415
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoft/TypeScript/issues/40157
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/40157
Wesley Wigham (weswigham)https://github.com/weswigham
Breaking ChangeWould introduce errors in existing codehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Breaking%20Change%22
Working as IntendedThe behavior described is the intended behavior; this is not a bughttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Working%20as%20Intended%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.