title: Nullable Reference Types and throwOnError pattern
body: <p>I'm trying to fully decorate an API that uses (what I call) the <code>throwOnError</code> pattern.
  I know some people dislike it but this is not the point: it is used by people far more clever than me, for instance in the <code>Assembly.GetType</code> method:</p>
  <p><code>public virtual Type? GetType(string name, bool throwOnError)</code></p>
  <p>I'm a little bit disappointed: it seems that currently (C#9/net5), it is not possible to state that the return cannot be null as long as throwOnError is true. Something like:  <code>[return: NotNullIfTrue( &quot;throwOnError&quot; )]</code>.</p>
  <p>The source here is (sadly) naked: <a href="https://source.dot.net/#System.Private.CoreLib/Assembly.cs,106" rel="nofollow noreferrer">https://source.dot.net/#System.Private.CoreLib/Assembly.cs,106</a></p>
  <p>Does anyone has a solution to this? Should we wait for a <em>NotNullIfTrue</em> attribute?</p>
  <p>PS: I don't want to use [DoesNotReturnIf(true)] since this is obvisoulsy a too strong assertion.</p>