<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body>
    On 16/04/2025 15:43, Adam Gent wrote:<br>
    <blockquote type="cite" cite="mid:b831bef4-c3e9-45a6-a352-8cdbe1f7525a@app.fastmail.com"><span style="white-space: pre-wrap">
</span>
      <pre class="moz-quote-pre" wrap="">:

You see orElse on `Optional` which is what people are familiar with and what I think is confusing given it has the same name is known in static analysis world of `PolyNull` where if I pass in `null` I'm going to get `null` back regardless of the container generic type.</pre>
    </blockquote>
    The proposal is that ScopedValue.orElse(T) doesn't accept null [1]
    so different to Optional.orElse. When null restricted types come
    then the hope is that it can change orElse(T!).<br>
    <br>
    -Alan<br>
    <br>
    [1]
<a class="moz-txt-link-freetext" href="https://download.java.net/java/early_access/loom/docs/api/java.base/java/lang/ScopedValue.html#orElse(T)">https://download.java.net/java/early_access/loom/docs/api/java.base/java/lang/ScopedValue.html#orElse(T)</a><br>
  </body>
</html>