An overloaded method sample, for named parameter call:
internal static dynamic TestMethod(int P1a, int P1b, params dynamic[] P1c)
{
//Sample Code
}
[Overload: P2] //illustration : Overload Specification
internal static dynamic TestMethod(int P2a, int P2b, params dynamic[] P2c)
{
//Sample Code
}
Having a new set of code organization, is to specify which overload to use using named parameters would resolve the problem or declare the method for overload selection;
TestMethod(P2: 1, 1,2,3,4,5);
They two features are not compatible. You would have to construct the array yourself, rather than having the compiler do that for you (an array is always constructed either way).
How do we know they're not compatible? From Argument lists:
Note that last sentence - you cannot have positional arguments after a named argument.
Runtime evaluation of argument lists:
...
(My emphasis)
That is, the
params
feature only works with positional arguments.