<html><body><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #000000"><div><br></div><div><br></div><hr id="zwchr" data-marker="__DIVIDER__"><div data-marker="__HEADERS__"><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><b>From: </b>"Brian Goetz" <brian.goetz@oracle.com><br><b>To: </b>"Remi Forax" <forax@univ-mlv.fr><br><b>Cc: </b>"valhalla-spec-experts" <valhalla-spec-experts@openjdk.java.net><br><b>Sent: </b>Wednesday, September 4, 2024 3:26:01 PM<br><b>Subject: </b>Re: Null-Restricted and Nullable Types<br></blockquote></div><div data-marker="__QUOTED_TEXT__"><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><font size="4" face="monospace">Let's take a step back.  Are you
      looking for *answers* in the short term (say, so you can answer
      someone elses questions), or are you looking to open the dialog
      about how we will expose nullness for purposes of generics
      migration?  Because there are many, many pages of things to say
      about these questions, not all of which we have answers to, and
      this will significantly affect how we structure the discussion.</font></blockquote><div><br></div><div>I'm opening the discussion. Those questions are like anchors to me, to try to avoid to go too deep into one of the rabbit holes.<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>Rémi<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><br>
    <br>
    <div class="moz-cite-prefix">On 9/4/2024 8:36 AM, <a class="moz-txt-link-abbreviated" href="mailto:forax@univ-mlv.fr" target="_blank">forax@univ-mlv.fr</a>
      wrote:<br>
    </div>
    <blockquote cite="mid:154950232.63481176.1725453401380.JavaMail.zimbra@univ-eiffel.fr">
      
      <div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #000000">
        <div>Here are my questions:<br>
        </div>
        <div><br>
        </div>
        <div>1/ Nullness of type variable<br>
        </div>
        <div>  "Like other types, a type-variable type (that is, a <em>use</em>
          of a type variable) may express nullness. <code>T!</code> is
          a null-restricted type, and <code>T?</code> is a nullable
          type."<br>
        </div>
        <div> - what does 'T' exactly mean ?<br>
        </div>
        <div>   For me, there is the old 'T' which propagate the type
          but not propagate the nullability and there is the new 'T'
          that propagate both the type and the nullability of the type.<br>
        </div>
        <div>   During the JVMLS, Dan Smith references them as 'T' and
          'T*'. </div>
        <div><br>
        </div>
        <div>2/ If we agree that there are 4 different kinds: String/T,
          String?/T?, String!/T! and T*, we now have the choice of
          several user facing models<br>
        </div>
        <div>  - model 1, we let the user annotate using '!', '?' and
          '*'<br>
        </div>
        <div>  - model 2, we have an opt-in mechanism that set type as
          '!' by default and type variable as '*' by default.<br>
        </div>
        <div>  - model 3, we only let user to annotate type variable
          declaration, type of field, type of parameter types/return
          type, parametrized type (inside the angle brackets) and cast,
          the rest is inferred<br>
              (this is the semantics of jspecify).</div>
        <div><br>
        </div>
        <div>
          <div>3/ Nullness of wildcards<br>
          </div>
          <div>  "A type variable declaration or wildcard may have
            nullness markers on its bounds. A type may satisfy the
            bounds via nullness conversion, though, so again these
            nullness markers are not strongly enforced, but may cause
            warnings."<br>
          </div>
          <div><br>
          </div>
          <div>  => I see two questions here :<br>
          </div>
          <div>   - unbounded wildcards, they are special because they
            represent a reified type, so ? is nullable in List<?>
            because list.add(null) is valid at runtime, thus
            List<?> is equivalent to List<? extends
            Object?>.</div>
          <div>     Do you agree ?</div>
          <div>   - super wildcard, the content of List<? super
            Foo!> may accept null because Foo? is a super type of
            Foo!, so List<? super Foo!> is maybe nullable or maybe
            not,</div>
          <div>     so the content is neither a '!' nor a '?'. Do you
            agree ?</div>
        </div>
        <div><br>
        </div>
        <div>Rémi<br>
        </div>
        <div><br>
        </div>
        <hr id="zwchr">
        <div>
          <blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><b>From:
            </b>"Brian Goetz" <a class="moz-txt-link-rfc2396E" href="mailto:brian.goetz@oracle.com" target="_blank"><brian.goetz@oracle.com></a><br>
            <b>To: </b>"Remi Forax" <a class="moz-txt-link-rfc2396E" href="mailto:forax@univ-mlv.fr" target="_blank"><forax@univ-mlv.fr></a>,
            "valhalla-spec-experts"
            <a class="moz-txt-link-rfc2396E" href="mailto:valhalla-spec-experts@openjdk.java.net" target="_blank"><valhalla-spec-experts@openjdk.java.net></a><br>
            <b>Sent: </b>Tuesday, September 3, 2024 10:44:03 PM<br>
            <b>Subject: </b>Re: Null-Restricted and Nullable Types<br>
          </blockquote>
        </div>
        <div>
          <blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><font size="4" face="monospace">There are many points that are
              not clear to us as well, but we will try to respond to
              your questions :)</font><br>
            <br>
            <div class="moz-cite-prefix">On 9/3/2024 4:41 PM, Remi Forax
              wrote:<br>
            </div>
            <blockquote cite="mid:1949658111.62587211.1725396089114.JavaMail.zimbra@univ-eiffel.fr">
              <pre class="moz-quote-pre">Hello,
if everybody is okay with that i would like to discuss about Null-Restricted and Nullable Types [1] tomorrow.

There are several points that are not clear to me, i will try to come up with a list for tomorrow.

Rémi

[1] <a class="moz-txt-link-freetext" href="https://openjdk.org/jeps/8303099" target="_blank">https://openjdk.org/jeps/8303099</a>
</pre>
            </blockquote>
            <br>
            <br>
          </blockquote>
        </div>
      </div>
    </blockquote>
    <br><br></blockquote></div></div></body></html>