O'Reilly logo

The Java® Language Specification, Java SE 7 Edition, Fourth Edition by Alex Buckley, Gilad Bracha, Guy Steele, Bill Joy, James Gosling

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

15.12.2.8. Inferring Unresolved Type Arguments

If any of the method’s type arguments were not inferred from the types of the actual arguments, they are now inferred as follows.

• If the method result occurs in a context where it will be subject to assignment conversion (§5.2) to a type S, then let R be the declared result type of the method, and let R’ = R[T1=B(T1) ... Tn=B(Tn)], where B(Ti) is the type inferred for Ti in the previous section or Ti if no type was inferred.

If S is a reference type, then let S’ be S. Otherwise, if S is a primitive type, then let S’ be the result of applying boxing conversion (§5.1.7) to S.

Then, a set of initial constraints consisting of:

♦ the constraint S’ >> R’, provided R is not void; and

♦ additional constraints ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required