dotnet / dotnet/command-line-api
The default value of a nullable "Array", "IEnumerable<T>", "IList<T>" or "ICollection<T>" should be "null"
Open
- Dominant language
- C#
- Stars
- 3.7k
- Forks
- 428
- PR merge metrics
- No merged PRs in 30d
Description
I noticed that the default value of `CliOption?>` always ends up being an empty list. This seems counterintuitive to me, as I explicitly defined the list to be nullable. The same applies for the types mentioned in the title.
Would it be possible to add some additional checks if the type is nullable here? https://github.com/dotnet/command-line-api/blob/6daed85086c41a1cd72a97f298f9cfe2beafa3f4/src/System.CommandLine/Argument%7BT%7D.cs#L168
Contributor guide
Assessment
This issue has not been assessed yet.