Consider the following extension methods:
public static void Toggle(this ref bool @bool) => @bool = !@bool;
public static void Toggle2(ref this bool @bool) => @bool = !@bool;
These simply toggle a ref boolean variable value. Testing:
class Foo
{
private bool _flag;
public void DoWork()
{
_flag.Toggle();
Console.WriteLine(_flag);
_flag.Toggle2();
Console.WriteLine(_flag);
}
}
We get:
True
False
The question: Is there any hidden difference in choosing one syntax or the other?
There is no difference. These are called modifiers, and their order in the specification is not defined.
You can read the section on method parameters in C# Language Specification here:
It lists out the different options and defines how they interact and mix, but says nothing about what order you must use.