Notes on implementing concise calls to constructors with type parameters
Paul Benedict
pbenedict at apache.org
Fri May 15 20:43:10 PDT 2009
After reading this board for a couple months, I was waiting for
someone to finally make this suggestion:
>> Cell<String> cs = new Cell(1);
>> treated as :
>> Cell<String> cs = new Cell<>(1);
YES! I think Ali Ebrahimi is making a noteworthy point here. Unless
the compiler can't possibly figure it out (???), there is never a need
to specify <> (empty angled brackets) when the genericized type on the
left-hand side exists. It's should be obvious in the grammar that
constructing new objects should be genercized regardless <> is
specified.
-- Paul
More information about the coin-dev
mailing list