You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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* expression
Prerequisites
Steps to reproduce
Invoking a method name without parentheses (without actually calling the method) is a convenient reflection feature in PowerShell; e.g.
(42).ToStringlists 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):Expected behavior
Actual behavior
Error details
No response
Environment data
Visuals
No response