<div dir="ltr">But we want a List<Integer> to be different from a List<int>. Thanks.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 2 Mar 2023 at 22:22, Gernot Neppert <<a href="mailto:mcnepp02@googlemail.com">mcnepp02@googlemail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>The following two lines are quotes from Dan's list of "key ideas":</div><div></div><div>
<pre>- Nullness is an *optional* property of variables/expressions/etc., distinct from types.<br>- Type variable types have nullness, too.<br><br></pre><pre>To me, this looks a little contradictory. If we agree on the first statement (and I do agree with it),<br></pre><pre>then Type-variables should not have an attached nullness-marker.<br></pre><pre>Rather, each _use_ of a Type-variable in a generic class would have the attached nullness.<br><br></pre><pre>Otherwise, a type-variable would again denote a "non-nullable" type, so you'd be back where you came from...<br></pre><pre><br></pre><pre>Consider the following example. IMHO, adding @NonNull to the type-variable would be of no real advantage.<br><br></pre><pre>class Holder<T> {<br></pre><pre> static <T> Holder<T> of(@NonNull T value) {<br>}<br>}
<br></pre><pre><br><br><br><br></pre>
</div></div>
</blockquote></div>