TIL (meaning, Tonight I Learned) that you can declare non-optional parameters after optional ones in C#.
Just create an indexer with optional parameters:
int this[int a, string b = "b"] { get; set; }
The IL for the set method is this:
instance void set_Item (
int32 a,
[opt] string b,
int32 'value'
) cil managed
{
.param [2] = "b"
}
Note that the "value" is after b.
And OH BOY does this matter when you're doing code gen, reading the method signature in Roslyn, and you realize you can't follow the method parameter order verbatim.