Skip to main content

Type arguments for a class shall be inferred on constructor invocation

2 replies [Last post]
elizarov
Offline
Joined: 2005-02-08
Points: 0

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
vpatryshev
Offline
Joined: 2004-06-30
Points: 0

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.)

elizarov
Offline
Joined: 2005-02-08
Points: 0

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.