Title: Errors on non-callable unions should be more specific · Issue #29013 · microsoft/TypeScript · GitHub
Open Graph Title: Errors on non-callable unions should be more specific · Issue #29013 · microsoft/TypeScript
X Title: Errors on non-callable unions should be more specific · Issue #29013 · microsoft/TypeScript
Description: While working on #29011 I realized that the error we produce for unions of things which look callable but for which we cannot synthesize a signature for are lackluster. We report an error like: Cannot use 'new' with an expression whose t...
Open Graph Description: While working on #29011 I realized that the error we produce for unions of things which look callable but for which we cannot synthesize a signature for are lackluster. We report an error like: Can...
X Description: While working on #29011 I realized that the error we produce for unions of things which look callable but for which we cannot synthesize a signature for are lackluster. We report an error like: Can...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/29013
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Errors on non-callable unions should be more specific","articleBody":"While working on #29011 I realized that the error we produce for unions of things which look callable but for which we cannot synthesize a signature for are lackluster. We report an error like:\r\n```\r\nCannot use 'new' with an expression whose type lacks a call or construct signature.\r\n```\r\nwhen we could do better and say something like\r\n```\r\nCannot use 'new' with an expression whose type lacks a call or construct signature. All members of union type {0} have call or construct signatures, but none are similar enough to resolve a call in a typesafe way.\r\n```\r\nwhich would make it far more clear what's going on in these scenarios.\r\n\r\nOnce #29011 is merged, the conditions can be even more specific, such as\r\n```\r\nCannot use 'new' with an expression whose type lacks a call or construct signature. All members of union type {0} have call or construct signatures, but more than one has overloads, which prevents this call from being resolved in a typesafe way.\r\n```\r\nand\r\n```\r\nCannot use 'new' with an expression whose type lacks a call or construct signature. All members of union type {0} have call or construct signatures, but more than one has type parameters, which prevents this call from being resolved in a typesafe way.\r\n```","author":{"url":"https://github.com/weswigham","@type":"Person","name":"weswigham"},"datePublished":"2018-12-13T23:31:54Z","url":"https://github.com/microsoft/TypeScript/issues/29013"}
| 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:1d48b42a-9772-56fb-a2d5-02e6a54e4a10 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D860:2C3566:863F00:B4081B:6B00DD6A |
| html-safe-nonce | 525789fb77701c99c74c815b44bf99b8c04dccec5fbbdb6d1ed8add807149a3b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEODYwOjJDMzU2Njo4NjNGMDA6QjQwODFCOjZCMDBERDZBIiwidmlzaXRvcl9pZCI6Ijc4MzI3MTUwMTg5NDM2NTExNzgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | fcb165c0f0d1f3ad328531c8598ad998550205dd99a5875d8c2436357baa4f78 |
| hovercard-subject-tag | issue:390905267 |
| 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/29013/issue_layout |
| twitter:image | https://opengraph.githubassets.com/fdbab1dd7bac9d9ee90c6c08456c74e57f162323b66266acd1cf385fffd5bfdf/microsoft/TypeScript/issues/29013 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/fdbab1dd7bac9d9ee90c6c08456c74e57f162323b66266acd1cf385fffd5bfdf/microsoft/TypeScript/issues/29013 |
| og:image:alt | While working on #29011 I realized that the error we produce for unions of things which look callable but for which we cannot synthesize a signature for are lackluster. We report an error like: Can... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | weswigham |
| hostname | github.com |
| expected-hostname | github.com |
| None | 043c3f30fbcbe2c6c8e729e10cbbbc90c406546f9fbbb67c648d38f6b7d16daf |
| 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 | 5425dc24e8bd8d6fca9641a12afc984825a43875 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width