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
With dotnet/msbuild#10209, we now permit users to use functions with out parameters and ref parameters as long as they don't care about the values that come out of them. Specifically, if a parameter is specified by '_', it will look for any method with the right name from the right assembly and try to match based on number of parameters. If there are multiple options, it will throw; if there is only one, it will execute it after tweaking all the _ to have the right type.
Example:
$([System.Int32]::TryParse("3", _))
Limitation:
This tries to infer which method overload of TryParse (or other function) to use, but if there are multiple overloads that could equally well fit the provided parameters and underscores, this will fail to determine definitively which function to use and will throw an error instead. This includes if a method currently has no conflicting overloads, and a new overload is added, which means a customer may see a breaking change in updating the version of an assembly in which the version update adds a new overload for a method they invoke that is indistinguishable from the method they intend to use. (I think this is very unlikely to occur, but it theoretically could.)
The text was updated successfully, but these errors were encountered:
Describe the issue or suggestion
With dotnet/msbuild#10209, we now permit users to use functions with out parameters and ref parameters as long as they don't care about the values that come out of them. Specifically, if a parameter is specified by '_', it will look for any method with the right name from the right assembly and try to match based on number of parameters. If there are multiple options, it will throw; if there is only one, it will execute it after tweaking all the _ to have the right type.
Example:
$([System.Int32]::TryParse("3", _))
Limitation:
This tries to infer which method overload of TryParse (or other function) to use, but if there are multiple overloads that could equally well fit the provided parameters and underscores, this will fail to determine definitively which function to use and will throw an error instead. This includes if a method currently has no conflicting overloads, and a new overload is added, which means a customer may see a breaking change in updating the version of an assembly in which the version update adds a new overload for a method they invoke that is indistinguishable from the method they intend to use. (I think this is very unlikely to occur, but it theoretically could.)
The text was updated successfully, but these errors were encountered: