list literal gotcha and suggestion

Paul Benedict pbenedict at apache.org
Thu Oct 1 13:26:19 PDT 2009


Forgive me if this was already suggested, but assuming [] will always
produce a list, couldn't the compile-time checking be enabled for a
static cast?

Set<Integer> = (Set<>)[1, 2, 3]; // OK
Set<Integer> = (Set<>)[1, 2, 1]; // Error

Paul



More information about the coin-dev mailing list