Seems like they are in general against using return type to discover type arguments, stating that it would be too much hassle.
Well, of course it looks very natural; and maybe they could do it at least in obvious cases like this. But imagine it is not an assignment, but a method call... (I'm just pondering; actually, I'd rather have this feature.)
I am not asking to infer types in the context of method invocation. I am pretty satisfied with the way it is working in JDK 5 (types are only inferred in the context of assignment). I am asking to blend the difference between static method call and construction invocation, because that difference really looks ugly.
Your use of this web site or any of its content or software indicates your agreement to be bound by these Terms of Participation.
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.