Title: Potential regression in 4.2 - Calling `.map` on `T[] | Y[]` is now callable but leads to an implicit any error · Issue #42646 · microsoft/TypeScript · GitHub
Open Graph Title: Potential regression in 4.2 - Calling `.map` on `T[] | Y[]` is now callable but leads to an implicit any error · Issue #42646 · microsoft/TypeScript
X Title: Potential regression in 4.2 - Calling `.map` on `T[] | Y[]` is now callable but leads to an implicit any error · Issue #42646 · microsoft/TypeScript
Description: Bug Report 🔎 Search Terms expression not callable union arrays 🕗 Version & Regression Information This changed between versions 4.1.3 and 4.2 beta ⏯ Playground Link https://www.typescriptlang.org/play?ts=4.1.3#code/CYUwxgNghgTiAEYD2A7Azg...
Open Graph Description: Bug Report 🔎 Search Terms expression not callable union arrays 🕗 Version & Regression Information This changed between versions 4.1.3 and 4.2 beta ⏯ Playground Link https://www.typescriptlang.org/p...
X Description: Bug Report 🔎 Search Terms expression not callable union arrays 🕗 Version & Regression Information This changed between versions 4.1.3 and 4.2 beta ⏯ Playground Link https://www.typescriptlang.o...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/42646
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Potential regression in 4.2 - Calling `.map` on `T[] | Y[]` is now callable but leads to an implicit any error","articleBody":"# Bug Report\r\n\r\n\u003c!--\r\n Please fill in each section completely. Thank you!\r\n-->\r\n\r\n### 🔎 Search Terms\r\n\r\n\u003c!--\r\n What search terms did you use when trying to find an existing bug report?\r\n List them here so people in the future can find this one more easily.\r\n-->\r\n\r\nexpression not callable union arrays\r\n\r\n### 🕗 Version & Regression Information\r\n\r\nThis changed between versions 4.1.3 and 4.2 beta\r\n\r\n### ⏯ Playground Link\r\n\r\nhttps://www.typescriptlang.org/play?ts=4.1.3#code/CYUwxgNghgTiAEYD2A7AzgF3gDwFzxQFcBbAIxBgG0BdeAH3kxgEsUBzGgKE+wDpioABwAUAM3gBeAHzxRASiA\r\n\r\nhttps://www.typescriptlang.org/play?ts=4.2.0-beta#code/CYUwxgNghgTiAEYD2A7AzgF3gDwFzxQFcBbAIxBgG0BdeAH3kxgEsUBzGgKE+wDpioABwAUAM3gBeAHzxRASiA\r\n\r\n### 💻 Code\r\n\r\n```ts\r\ndeclare const x: number[] | string[]\r\n\r\nx.map(f => f)\r\n```\r\n\r\n### 🙁 Actual behavior\r\n\r\n`.map` is now callable but `f` as an implicit type of `any`, leading to an implicit any error.\r\n\r\n### 🙂 Expected behavior\r\n\r\nThe current behaviour in 4.1.3 is to mark the `map()` call as not callable as well as `f` should have an implicit any type.\r\n\r\nI don't know if this is a regression but I'm raising it because this change in behaviour is not documented in the release notes.\r\n","author":{"url":"https://github.com/tom-sherman","@type":"Person","name":"tom-sherman"},"datePublished":"2021-02-04T16:56:41Z","url":"https://github.com/microsoft/TypeScript/issues/42646"}
| react-profiling | 0 |
| react-import-map | react,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-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:f271ed81-9adf-7d96-7684-eeedfe860b15 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BAF0:14F601:ABE039:DDF6A9:6B00E3F9 |
| html-safe-nonce | f7c933d589cf371499bcdc891398eb0f39b077895b5a6b595e71777deaa96a78 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQUYwOjE0RjYwMTpBQkUwMzk6RERGNkE5OjZCMDBFM0Y5IiwidmlzaXRvcl9pZCI6IjgzOTg5NTk3MTQ3OTIxNzA0ODkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | ed68e9ade9bcd2578787a8f03cb020e329b6e093e84ba593f739b0b309cbb3cf |
| hovercard-subject-tag | issue:801465696 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/TypeScript/42646/issue_layout |
| twitter:image | https://opengraph.githubassets.com/68a3b34755afe7e4fe7a976a9683f2e8ded3af54240d9bfe037d5de78603e1e9/microsoft/TypeScript/issues/42646 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/68a3b34755afe7e4fe7a976a9683f2e8ded3af54240d9bfe037d5de78603e1e9/microsoft/TypeScript/issues/42646 |
| og:image:alt | Bug Report 🔎 Search Terms expression not callable union arrays 🕗 Version & Regression Information This changed between versions 4.1.3 and 4.2 beta ⏯ Playground Link https://www.typescriptlang.org/p... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | tom-sherman |
| hostname | github.com |
| expected-hostname | github.com |
| None | 27088b6977484d0d3321d9a11c907c6d6637b315cfa359ef7952dbf6292f9b14 |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 20929025 |
| octolytics-dimension-repository_nwo | microsoft/TypeScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 20929025 |
| octolytics-dimension-repository_network_root_nwo | microsoft/TypeScript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 624179fb8b88d26ba5bba08894eb60a1c5a1d93d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width