I would expect these two calls to function identically- a params argument is an array in the called method. Jon Skeet's example in the previous question works because an array of int's is not covariant to an array of objects (and so is treated as new Object[] { new Int[] {1,2,3} }
), but in this example an array of FooBars is covariant to an array of objects, and so your parameter is expanded into the objs
argument.
Wikipedia of all things covers this exact case: Covariance and contravariance (computer science)
Sorry but I am sure that this is not a compiler bug.
EDIT:
You can achieve what you want thus:
Foo(new Object[] { new Bar[] { new Bar(1), new Bar(2), new Bar(3) } });
NEW EDIT (other author):
Or simply use:
Foo((Object)new Bar[] { new Bar(1), new Bar(2), new Bar(3) });