Roslyn: Permit a trailing comma inside a switch expression

Created on 9 Jan 2019  路  5Comments  路  Source: dotnet/roslyn

Per LDM 2019-01-09 we have accepted the proposal in https://github.com/dotnet/csharplang/issues/2098 to allow a trailing comma inside a switch expression
``` c#
_ = e switch
{
1 => 2,
3 => 4, // comma now allowed here
}

Similarly, we have accepted a proposal to allow a trailing comma inside a property subpattern.
``` c#
_ = e is T
    {
        X: 2,
        Y: 3, // comma now allowed here
    };

This needs to be implemented.

Area-Compilers Bug New Language Feature - Pattern Matching

Most helpful comment

@alrz Yes, inside property patterns too (approved yesterday).

All 5 comments

Thanks!

what about property patterns?

https://en.wikipedia.org/wiki/Whataboutism ;)

@alrz Yes, inside property patterns too (approved yesterday).

Awesome!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

codingonHP picture codingonHP  路  3Comments

ashmind picture ashmind  路  3Comments

NikChao picture NikChao  路  3Comments

MadsTorgersen picture MadsTorgersen  路  3Comments

orthoxerox picture orthoxerox  路  3Comments