-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Closed
Labels
Needs-TriageThe issue is new and needs to be triaged by a work group.The issue is new and needs to be triaged by a work group.Resolution-No ActivityIssue has had no activity for 6 months or moreIssue has had no activity for 6 months or more
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 reproduce
Invoking 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.
However, this doesn't work with the new-in-7.3 syntax (see about_Calling_Generic_Methods) for calling generic methods with explicit type arguments (e.g., [Array]::Empty[int]() to create an empty [int[]] array):
[Array]::Empty # OK without type argument
[Array]::Empty[int] # !! BROKEN: treats [int] as an *index* expressionExpected behavior
OverloadDefinitions
-------------------
static T[] Empty[T]()
static int[] Empty[int]()Actual behavior
ParserError: ...
Line |
51 | [Array]::Empty[int]
| ~
| Array index expression is missing or not valid.Error details
No response
Environment data
PowerShell Core 7.3.0-preview.5Visuals
No response
Metadata
Metadata
Assignees
Labels
Needs-TriageThe issue is new and needs to be triaged by a work group.The issue is new and needs to be triaged by a work group.Resolution-No ActivityIssue has had no activity for 6 months or moreIssue has had no activity for 6 months or more