Skip to content

Commit

Permalink
Fix System.CommandLine regression when creating repro packages (#78924)
Browse files Browse the repository at this point in the history
Co-authored-by: Michal Strehovský <MichalStrehovsky@users.noreply.github.com>

Fixes #78921
  • Loading branch information
ivanpovazan authored Dec 1, 2022
1 parent 067e43a commit 39b6e5e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/coreclr/tools/Common/CommandLineHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,11 @@ public static void MakeReproPackage(string makeReproPath, string outputFilePath,
object val = res.CommandResult.GetValue(option);
if (val is not null && !(descriptor.HasDefaultValue && descriptor.GetDefaultValue().Equals(val)))
{
if (val is IEnumerable<string> values)
if (val is IEnumerable<string> || val is IDictionary<string, string>)
{
if (val is not IEnumerable<string> values)
values = ((IDictionary<string, string>)val).Values;

if (inputOptionNames.Contains(option.Name))
{
Dictionary<string, string> dictionary = new();
Expand Down Expand Up @@ -214,8 +217,11 @@ public static void MakeReproPackage(string makeReproPath, string outputFilePath,
foreach (var argument in res.CommandResult.Command.Arguments)
{
object val = res.CommandResult.GetValue(argument);
if (val is IEnumerable<string> values)
if (val is IEnumerable<string> || val is IDictionary<string, string>)
{
if (val is not IEnumerable<string> values)
values = ((IDictionary<string, string>)val).Values;

foreach (string optInList in values)
{
rspFile.Add($"{ConvertFromInputPathToReproPackagePath((string)optInList)}");
Expand Down

0 comments on commit 39b6e5e

Please # to comment.