# C# Language Design Meeting for July 24th, 2024

## Agenda

- [Discriminated Unions](#discriminated-unions)
- [Better conversion from collection expression with `ReadOnlySpan<T>` overloads](#better-conversion-from-collection-expression-with-readonlyspant-overloads)

## Quote of the Day

- "I put that there so people will complain"

## Discussion

### Discriminated Unions

Champion issue: https://github.com/dotnet/csharplang/issues/113  
Proposal: https://github.com/dotnet/csharplang/blob/18a527bcc1f0bdaf542d8b9a189c50068615b439/proposals/TypeUnions.md

First up today, the discriminated unions working group presented the proposal they've been working on for a while to the broader LDM. This was a broad overview session, rather than a deep dive into nitty-gritty
questions; there are still plenty of little details that will need to be filled in, but we're cautiously optimistic about this proposal and moving forward with it. There was some concern about some of the
ternary behavior, but we can dig more into that as we bring this proposal back for detailed follow ups in the future.

### Better conversion from collection expression with `ReadOnlySpan<T>` overloads

Champion issue: https://github.com/dotnet/csharplang/issues/8297  
Related issue: https://github.com/dotnet/roslyn/issues/73857

We followed up from [last Wednesday](LDM-2024-07-17.md#better-conversion-from-collection-expression-with-readonlyspant-overloads), revisiting an even narrower proposal; just looking at implicit reference
conversions, rather than all implicit conversions except numeric conversions. However, LDM still does not prefer the narrow fix; it has edge cases and isn't generalizable. There is some concern that rules around
`OverloadResolutionPriority` might not work here; `string.Concat` has 15 overloads in .NET 9, and this isn't the type of break-glass scenario `OverloadResolutionPriority` was designed for. Given this, we reaffirm
that we want to look into doing the recursive approach, ie better conversion from element.

#### Conclusion

Continue looking into option 3, better conversion from element.
