JDK-6242254 : Language support for type inference
  • Type: Enhancement
  • Component: specification
  • Sub-Component: language
  • Affected Version: 6
  • Priority: P4
  • Status: Closed
  • Resolution: Won't Fix
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2005-03-17
  • Updated: 2010-05-09
  • Resolved: 2005-04-26
Related Reports
Relates :  
Relates :  
Description
A DESCRIPTION OF THE REQUEST :
Simplify static typing, generics by adding support for type inference. This is described briefly here: http://c2.com/cgi/wiki?TypeInference

JUSTIFICATION :
Generics decreases the readability of code in exchange for stronger type safety. Type inferance will maintain strong type safety and improve readability again.
###@###.### 2005-03-17 17:36:43 GMT

Comments
EVALUATION I'll have to guess at what is being requested here. The URL provided points at a general purpose Wiki page discussing type inference. Well, thank you very much, I've heard of type inference before. Presumably, the user wants to avoid providing actual type arguments for generic types (much as we avoid them when using generic methods). The decision not to pursue this was a very deliberate one. The largest benefit of generics (and type systems in general) is documentation. This of course, is not what the academic functional programming community thinks. But lessons learned in that space (assuming they are valid even there, not something I will grant you) do not necessarily hold in a language like Java. Even if one buys into the idea that this is a worthy goal, it seems questionable to attempt it anyway. Obviously, Hindley-Milner type inference is irrelevant here. A few Ph.D. theses 10-15 years ago pursued that idea without much success. More sophisticated approaches can be made to work in some circumstances, but the complexity is mind boggling. ###@###.### 2005-04-26 17:45:36 GMT
26-04-2005