How to generate labels on Switch expressions at C# 8.0, like on switch statement at previous C#

How do I generate labels on switch expressions by ReSharper. I can on switch statement.

I can generate -> switch(type) { ... }

I cannot generate -> type switch { ... }

1
2 comments
Official comment

Hello,

thank you for contacting us.

You could use the “Add missing arms”  quick-fix for it.

For example, in this code block:

retGN = bGN switch
{

};

put cursor on switch and press “Alt+Enter”;

choose “Add missing arms”;

the result:

retGN = bGN switch
{
    true => expr,
    false => expr
};

Thank you!

I’d lile to know too :)

0

Please sign in to leave a comment.