# C# Language Design Meeting for September 26th, 2022

## Agenda

- [Working set triage](#working-set-triage)
    - [Roles & Extensions](#roles--extensions)
    - [Discriminated Unions](#discriminated-unions)
    - [Bridging statements and expressions](#bridging-statements-and-expressions)
    - [Construction improvements](#construction-improvements)
    - [`ref struct` improvements](#ref-struct-improvements)
    - [`params` improvements](#params-improvements)
    - [Ungrouped](#ungrouped)

## Quote of the day

- *Makes a dad joke* "We saw that look on your face."

### Working set triage

Today, we went through a significant portion of the current working set of items, and triaged them into a few categories:

* Working group themes. We had good success with a smaller working group on `required` members, and we would like to extend the same
strategy to other larger items. For each such area, we'll create a working group to investigate all related issues.
* Ungrouped features. These are generally smaller features or features with a relatively straightforward design that don't need large
amounts of design time to pursue.

Importantly, we didn't get through everything in the working set today, so some of these categories are currently light. We'll finish our pass
next meeting.

#### Roles & Extensions

We already have an internal working group for this topic, and they will be continuing to work on it. Related issues:

* https://github.com/dotnet/csharplang/issues/110 - Type classes
    * One of the motivating scenarios for roles
* https://github.com/dotnet/csharplang/issues/5497 - Roles & Extensions


#### Discriminated Unions

This is one of the biggest things that we think will benefit from a smaller group to make design progress. There are a number of
areas to investigate, as demonstrated by the open related issues:

* https://github.com/dotnet/csharplang/issues/113 - Discriminated unions
* https://github.com/dotnet/csharplang/issues/485 - `closed` type hierarchies
* https://github.com/dotnet/csharplang/issues/3179 - `closed` enums
* https://github.com/dotnet/csharplang/issues/2926 - Target-typed name lookup
    * We don't want to gate this on DUs, but it will be highly complementary

#### Bridging statements and expressions

We think there are two main subcategories here: the general feature of block expressions, and more specific improvements and unification
of switch statements and expressions. Related issues:

* https://github.com/dotnet/csharplang/issues/377 - Sequence expressions
* https://github.com/dotnet/csharplang/issues/3037 - Block-bodied switch expression arms
* https://github.com/dotnet/csharplang/issues/3038 - Enhanced switch statements
* https://github.com/dotnet/csharplang/issues/3086 - Expression blocks

#### Construction improvements

We have a few issues related to general construction improvements, such as generalized support for factories, support for final initializers,
generalized `with` support, and others. Related issues:

* https://github.com/dotnet/csharplang/issues/162 - Pattern-based `with` expressions
    * It is irksome, but do we have customers who really want it?
    * Not sure we would spend time on this currently
    * Moved to the backlog.

#### `ref struct` improvements

There are three interrelated, major improvements that need to be done in parallel: `ref struct`s implementing interfaces, `ref struct`s in
generics, and ref fields to ref structs

* https://github.com/dotnet/csharplang/issues/1148 - `where T : ref struct`

#### `params` improvements

This doesn't need a full group, just a single dev to investigate and bring back a list of all the things to support in `params`. The `Span<T>`
is blocked on runtime support, but the other parts of the feature can proceed without waiting for it. Related issues:

* https://github.com/dotnet/csharplang/issues/1757 - `params Span<T>`
* https://github.com/dotnet/csharplang/issues/179 - `params IEnumerable`
* https://github.com/dotnet/csharplang/discussions/6489 - Discussion on `params Span<T>`
* https://github.com/dotnet/csharplang/discussions/6490 - Discussion on more `params` abilities
* https://github.com/dotnet/csharplang/discussions/6491 - Discussion on pattern-based `params`

#### Ungrouped

Finally, these are the issues that we don't feel need a working group to drive them.

* https://github.com/dotnet/csharplang/issues/133 - Property-scoped fields
    * Still think it will be after `field`.
    * Into the backlog, as we are currently focused on #140.
* https://github.com/dotnet/csharplang/issues/140 - `field`
    * Will proceed, try to get in for C# 12 after questions are resolved
* https://github.com/dotnet/csharplang/issues/1358 - `default` in deconstruction
    * Small and independent, but needs LDM input to proceed.
* https://github.com/dotnet/csharplang/issues/2302 - Efficient `params` and string formatting
    * Was split up into multiple issues, some of which are already done. Will close and link.
* https://github.com/dotnet/csharplang/issues/2180 - Allow omitting unused parameters
    * We don't think this is currently important. Will move to the backlog.
* https://github.com/dotnet/csharplang/issues/2691 - Primary Constructors
    * Still needs an agreed-upon proposal. We've been meaning to bring one for discussion.
* https://github.com/dotnet/csharplang/issues/3507 - Ignored directive support
    * Leaving as is
* https://github.com/dotnet/csharplang/issues/3658 - Repeated Attributes in Partial Members
    * We're unlikely to make progress on this ourselves, but would accept community contributions here. Moved to Any Time.
