1
$\begingroup$

I am reading through Java Language Specification SE 7, in the paragraph 4.5.1 there is a phrase as follows:

A type argument T1 is said to contain another type argument T2, written T2 <= T1, if the set of types denoted by T2 is provably a subset of the set of types denoted by T1 under the reflexive and transitive closure of the following rules (where <: denotes subtyping (§4.10)):

  • ? extends T <= ? extends S if T <: S
  • ? super T <= ? super S if S <: T
  • T <= T
  • T <= ? extends T
  • T <= ? super T

I understand that there is the reflexive and transitive closure of the rules and do not understand what T2 is provably a subset of the T1 set under that closure means. Could anyone explain me that? Any references (books/papers) will be very appreciated as well.

$\endgroup$
1
$\begingroup$

This is rather badly written. I believe that what they mean is:

A type argument $T_1$ is said to contain another type argument $T_2$ if $T_2\le T_1$, where $\le$ is the reflexive and transitive closure of the following rules (where <: denotes subtyping (§4.10)):

  • ? extends $T$ $\le$ ? extends $S$ if $T$ <: $S$
  • ? super $T$ $\le$ ? super $S$ if $S$ <: $T$
  • $T\le T$
  • $T$ $\le$ ? extends $T$
  • $T$ $\le$ ? super $T$

If $T_2\le T_1$, the set of types denoted by $T_2$ is provably a subset of the set of types denoted by $T_1$.

(Or perhaps one could replace "if" by "if and only if" in the last line.)

(By the way, "reflexive" and the rule $T\le T$ are redundant.)

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.