meetings/2025/LDM-2025-04-14.md
Champion issue: https://github.com/dotnet/csharplang/issues/8887
Specification: https://github.com/dotnet/csharplang/blob/e2e62a49d32f0d659b8baf0f23ee211b69563c65/proposals/dictionary-expressions.md#open-questions
Should [a ? [b] : c] be parsed as [a ? ([b]) : (c)] or [(a?[b]) : c]?
Parse as [a ? ([b]) : (c)]. If the user intends to use the conditional operator, they can use parentheses and [(a?[b]) : c].
IDictionary when targeting IReadOnlyDictionary<,>The existing types we might use to implement IReadOnlyDictionary implement IDictionary and implementing the interface on future types is not onerous.
The type used when target typing IReadOnlyDictionary<,> should implement IDictionary.
Champion issue: https://github.com/dotnet/csharplang/issues/8887
Specification: https://github.com/dotnet/csharplang/blob/e2e62a49d32f0d659b8baf0f23ee211b69563c65/proposals/collection-expression-arguments.md#open-questions
Types that require at least one argument in all constructors and factory methods can't be used for params collections. We discussed whether conversions should be supported for collection expressions for these types.
We also discussed whether to require the presence of with to allow these conversions.
Yes, conversions will be supported.
Yes, require with to allow these conversions.
For concrete types, we support the arguments available on constructors or factory methods.
But, should we support arguments for interface target types, and if so, what method signatures should be used binding the arguments.
Using the available constructors may result in signatures that are not particularly helpful. For example, when including a collection in a collection expression, a spread operator seems more clear than a with parameter. And depending on the types involved, what's allowed may be unexpected:
List<int> list1 = [with(otherList)]; // allowed.
IList<int> list2 = [with(otherList)]; // not allowed.
IList<int> list3 = (List<int>)[with(otherList)]; // allowed.
There are a small number of constructor args that are very useful in collection expressions, such as:
Now that we understand the implications of a generalized solution for comparer and capacity, we are less certain that the generalized solution is the correct approach - so we will reconsider this. The team will explore what arguments are useful and return with a curated list and recommendation. We can add support for additional arguments as use cases arise.
We see very little value in supporting __arglist in collection expression arguments.
We will not support __arglist unless they are "free" to support.