Title: New syntax for invoking generic methods doesn't support overload reporting when invoked without parentheses · Issue #17668 · PowerShell/PowerShell · GitHub
Open Graph Title: New syntax for invoking generic methods doesn't support overload reporting when invoked without parentheses · Issue #17668 · PowerShell/PowerShell
X Title: New syntax for invoking generic methods doesn't support overload reporting when invoked without parentheses · Issue #17668 · PowerShell/PowerShell
Description: Prerequisites Write a descriptive title. Make sure you are able to repro it on the latest released version Search the existing issues. Refer to the FAQ. Refer to Differences between Windows PowerShell 5.1 and PowerShell. Steps to reprodu...
Open Graph Description: Prerequisites Write a descriptive title. Make sure you are able to repro it on the latest released version Search the existing issues. Refer to the FAQ. Refer to Differences between Windows PowerSh...
X Description: Prerequisites Write a descriptive title. Make sure you are able to repro it on the latest released version Search the existing issues. Refer to the FAQ. Refer to Differences between Windows PowerSh...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/17668
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"New syntax for invoking generic methods doesn't support overload reporting when invoked without parentheses","articleBody":"### Prerequisites\r\n\r\n- [X] Write a descriptive title.\r\n- [X] Make sure you are able to repro it on the [latest released version](https://github.com/PowerShell/PowerShell/releases)\r\n- [X] Search the existing issues.\r\n- [X] Refer to the [FAQ](https://github.com/PowerShell/PowerShell/blob/master/docs/FAQ.md).\r\n- [X] Refer to [Differences between Windows PowerShell 5.1 and PowerShell](https://docs.microsoft.com/powershell/scripting/whats-new/differences-from-windows-powershell).\r\n\r\n### Steps to reproduce\r\n\r\nInvoking a method name without parentheses (without actually _calling_ the method) is a convenient reflection feature in PowerShell; e.g. `(42).ToString` lists all overloads of the `[int]` type's `.ToString()` method.\r\n\r\nHowever, this doesn't work with the new-in-7.3 syntax (see [about_Calling_Generic_Methods](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_Calling_Generic_Methods)) for calling generic methods with explicit type arguments (e.g., `[Array]::Empty[int]()` to create an empty `[int[]]` array):\r\n\r\n```powershell\r\n[Array]::Empty # OK without type argument\r\n[Array]::Empty[int] # !! BROKEN: treats [int] as an *index* expression\r\n```\r\n\r\n\r\n\r\n### Expected behavior\r\n\r\n```console\r\nOverloadDefinitions\r\n-------------------\r\nstatic T[] Empty[T]()\r\n\r\nstatic int[] Empty[int]()\r\n```\r\n\r\n\r\n### Actual behavior\r\n\r\n```console\r\nParserError: ...\r\nLine |\r\n 51 | [Array]::Empty[int]\r\n | ~\r\n | Array index expression is missing or not valid.\r\n```\r\n\r\n\r\n### Error details\r\n\r\n_No response_\r\n\r\n### Environment data\r\n\r\n```powershell\r\nPowerShell Core 7.3.0-preview.5\r\n```\r\n\r\n\r\n### Visuals\r\n\r\n_No response_","author":{"url":"https://github.com/mklement0","@type":"Person","name":"mklement0"},"datePublished":"2022-07-12T13:21:57.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":7},"url":"https://github.com/17668/PowerShell/issues/17668"}
| 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:5e9dc3ce-0fcf-3fc1-a117-12269c93716c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 900A:273A67:2CC5B34:3CD3BD0:6A54946E |
| html-safe-nonce | 5ac694e0229d05101fb3efb4ea0a7dc31e9a7de896e34b0cb55861d8bfb8eef4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MDBBOjI3M0E2NzoyQ0M1QjM0OjNDRDNCRDA6NkE1NDk0NkUiLCJ2aXNpdG9yX2lkIjoiMjkyNjI1NzMxNjE0NzAwODYyMiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 8bed66c9168d5374f81d55b6ee3cdd1ec03d2438fdbe63d0422438c51eef6193 |
| hovercard-subject-tag | issue:1302058167 |
| 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/PowerShell/PowerShell/17668/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c18cfb60e45f1e03c65ed5204cd1948797fbf5646cb0b49355b6904bf536c71b/PowerShell/PowerShell/issues/17668 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c18cfb60e45f1e03c65ed5204cd1948797fbf5646cb0b49355b6904bf536c71b/PowerShell/PowerShell/issues/17668 |
| og:image:alt | Prerequisites Write a descriptive title. Make sure you are able to repro it on the latest released version Search the existing issues. Refer to the FAQ. Refer to Differences between Windows PowerSh... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mklement0 |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| go-import | github.com/PowerShell/PowerShell git https://github.com/PowerShell/PowerShell.git |
| octolytics-dimension-user_id | 11524380 |
| octolytics-dimension-user_login | PowerShell |
| octolytics-dimension-repository_id | 49609581 |
| octolytics-dimension-repository_nwo | PowerShell/PowerShell |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 49609581 |
| octolytics-dimension-repository_network_root_nwo | PowerShell/PowerShell |
| 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 | f8cfff6384f62259baea531c7f58bc7040f8dd92 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width