[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-lambda-dev
Subject:    clarification of 18.2.3
From:       "Rafkind, Jon" <jon.rafkind () hp ! com>
Date:       2013-10-29 1:06:33
Message-ID: C39D17F71FB39E488EA35B99FB027447126BA2F8 () G9W0743 ! americas ! hpqcorp ! net
[Download RAW message or body]

Section 18.2.3 Subtyping Constraints of jsr 335 says

A constraint formula of the form ⟨S <: T⟩ is reduced as follows:
  ...
  If T is a non-parameterized class or interface type, C, then the constraint reduces \
to true if S is a parameterization of C, or if C is a superclass or superinterface of \
T, and false otherwise.

1. What is the point of introducing a new metavariable C? It seems that C == T
2. I assume the point of this rule is to handle the case where a type has T does not \
have type parameters even though its class declaration has them:

List<a1> <: List

Where a1 is some inference variable. In this case, any parameterization of List is a \
subtype of List. Is that right?

3. The last clause seems vacuous. 'if C is a superclass/superinterface of T' but C == \
T, so assuming superclass/superinterface means a proper super then C can never be its \
own super type. Also this leaves S out. Is it a typo, and it should instead read as

'or if C is a superclass or superinterface of S ...'

Which would handle the case of

List<a1> <: Collection


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic