13. A system, comprising: one or more processors; a memory coupled to the one or more processors, wherein the memory stores program instructions executable by the one or more processors to implement: a compiler receiving source code for a computer program; the compiler determining that the source code includes an assignment context associating a variable with a value, the assignment context having: a declaration expression introducing the variable, wherein the declaration expression specifies a part of a type for the variable and does not specify another part of the type for the variable, wherein: the type for the variable is a parameterized type; the part of the type specified in the declaration expression comprises a ground type; the part of the type not specified in the declaration expression comprises one or more type arguments for the parameterized type; and an initialization expression whose evaluation will result in the value, wherein a type of the initialization expression is a parameterized type corresponding to a given ground type and one or more type arguments; the compiler inferring the type for the variable based at least on the specified part of the type in the parameterized type in the declaration expression and on the parameterized type of the initialization expression, wherein to infer the type for the variable, the compiler: identifies a generic type corresponding to the parameterized type of the initialization expression; identifies a generic supertype of the identified generic type, wherein the identified generic supertype has the same ground type as a ground type indicated by the part of the type for the variable introduced in the declaration expression; and infers a parameterized type for the variable by parameterizing the generic supertype with one or more type arguments of the parameterized type of the initialization expression; in response to said inferring, the compiler binding the variable to the inferred type; and the compiler compiling the source code into an executable version of the computer program, wherein the compiling is dependent on the binding of the variable to the inferred type.
16. The system of claim 13 , wherein the assignment context is an assignment expression that includes the declaration expression and the initialization expression.