Description
Consider the idl:
If the implementation of this function returns an empty array, the CsWinRT projection will return null. But it is expected to return a non-null empty array.
The downside of empty arrays being projected as null is that it forces the consumer to write unnatural code:
string[] items = thing.GetItems();
if (items != null)
{
foreach (var item in items)
{
Console.WriteLine(item);
}
}
instead of the more idiomatic:
foreach (var item in thing.GetItems())
{
Console.WriteLine(item);
}
@oldnewthing as FYI.
Steps To Reproduce
See description.
Expected Behavior
See description.
Version Info
2.2.0
Additional Context
No response