-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Description
Version Used: VS 18.2.0
Steps to Reproduce:
Invoke "Use coalesce expression" on the if keyword.
class C
{
public void M()
{
#pragma warning disable
var value = M2();
// Test
#pragma warning restore
if (value == null)
{
throw new InvalidOperationException();
}
}
string? M2() => null;
}Expected Behavior: The trivia (comment, directive) is retained and placed after the rewritten statement.
Actual Behavior: The trivia is dropped entirely.

Reactions are currently unavailable