list literal gotcha and suggestion

Neal Gafter neal at gafter.com
Wed Oct 7 09:00:06 PDT 2009


On Wed, Oct 7, 2009 at 8:55 AM, Reinier Zwitserloot <reinier at zwitserloot.com
> wrote:

> So, when passing {1, 2, 3} to a method that takes 1 Collection, it will
> not, in fact, work without an explicit cast, then. Okay. As I said, I think
> that's quite a serious use case.
>

Correction: when passing {1, 2, 3} to a method that takes 1 Collection, it
will, in fact, work without a cast.

Before you suggest that, then, the construct will default to a List - I'm
> not sure that's a good idea
>

I'm suggesting that there be no such default.



More information about the coin-dev mailing list