LVTI: as per spec upward projection couldn't have resulted in a '? extends' parameterization

Dan Smith daniel.smith at oracle.com
Thu Oct 12 22:41:11 UTC 2017


> On Oct 12, 2017, at 11:53 AM, Georgiy Rakov <georgiy.rakov at oracle.com> wrote:
> 
> Here T is 'CAP extends C1 super NULL_TYPE' as per capture conversion and restricted type variable include just the same CAP.
> 
> Rule (4) doesn't apply so according to rule (5): downward_projection(CAP) = downward_projection(NULL_TYPE) = NULL_TYPE, NULL_TYPE doesn't mention any restricted type variable so downward projection of NULL_TYPE is NULL_TYPE according to rule (4).

Yep, this is a problem.

The rules were designed based on a model in which capture variables don't use the null type as their lower bound, but just don't have lower bounds when not needed (like all other type variables).

But, yes, it seems that the longstanding behavior of JLS is to claim the null type is a lower bound (per 5.1.10).

I'll fix the downward projection rules. The intent is that the downward projection of CAP is undefined.

—Dan


More information about the compiler-dev mailing list