Version Used: VS 18.0.0 Insiders [11109.219]
Steps to Reproduce:
Observe the method declaration for M.
static class D
{
class C
{
public C()
{
this.M();
}
}
extension (C c)
{
private void M()
{
}
}
}
Expected Behavior:
Since the method is used, it is not marked as unused.
Actual Behavior:
The method M is greyed out and IDE0051 is reported. If you select the code fix "Remove unused member", the code breaks.
Note: if you declare the extension method in the "old way" (i.e. private static void M(this C c)), this will not occur.
In the following screenshot, you can even see that the syntax highlighter shows that the method is actually used.

Version Used: VS 18.0.0 Insiders [11109.219]
Steps to Reproduce:
Observe the method declaration for
M.Expected Behavior:
Since the method is used, it is not marked as unused.
Actual Behavior:
The method M is greyed out and IDE0051 is reported. If you select the code fix "Remove unused member", the code breaks.
Note: if you declare the extension method in the "old way" (i.e.
private static void M(this C c)), this will not occur.In the following screenshot, you can even see that the syntax highlighter shows that the method is actually used.
