Optional parameters do not change the signature of the method. They simply declare default values for the parameters. This information is used by the compiler to supply values when you omit them in your code. The compiled code will still pass arguments for all parameters.
In your case, the method Foo
is still declared as taking two int
arguments as input. There is no version of Foo
that can be invoked with one parameter only (remember, the compiler fills in the blanks for you there). Any delegates used for invoking methods with optional parameters, need to explicitly include all parameters in order to match the signature.