See section 7.5.3.1 of the C# spec:
7.5.3.1 Applicable function member
A function member is said to be an applicable function member with respect to an argument list A when all of the following are true:
- Each argument in A corresponds to a parameter in the function member declaration as described in §7.5.1.1, and any parameter to which no argument corresponds is an optional parameter.
- For each argument in A, the parameter passing mode of the argument (i.e., value, ref, or out) is identical to the parameter passing mode of the corresponding parameter, and
- for a value parameter or a parameter array, an implicit conversion (§6.1) exists from the argument to the type of the corresponding parameter, or
- [... some irrelevant material concerning
ref
and out
parameters ...]
For a function member that includes a parameter array, if the function member is applicable by the above rules, it is said to be applicable in its normal form. If a function member that includes a parameter array is not applicable in its normal form, the function member may instead be applicable in its expanded form[.]
Because the array you passed can be implicitly converted to object[]
, and because overload resolution prefers "normal" form over "expanded" form, the behavior you observe conforms to the specification, and there is no bug.
In addition to the workaround described by Chris Shain, you could also change Bar
from a class to a struct; that makes the array no longer implicitly convertible to object[]
, so you'll get the behavior you desire.