title: C#8 nullable : string.IsNullOrEmpty is not understood by compiler as helping for guarding against null
body: <p>I am using C# 8 with .NET framework 4.8</p>
  
  <p>I'm currently guarding against a potential string that can be null with <code>IsNullOrWhitespace</code> (same problem with <code>IsNullOrEmpty</code>) , but the compiler is still complaining :</p>
  
  <pre><code>public MyImage? LoadImage(string? filename)
  {
      if (string.IsNullOrWhiteSpace(filename))
      {
          return null;
      }
      return OtherMethod(filename); // here : warning from Visual Studio
  }
  
  // signature of other method :
  public MyImage OtherMethod(string filepath);
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/TG8jK.png" rel="noreferrer"><img src="https://i.stack.imgur.com/TG8jK.png" alt="Hint / warning from VS : &#39;filename&#39; may be null here."></a></p>
  
  <p>currently, I have workarounds to make the compiler understand :</p>
  
  <ul>
  <li>use null forgiving operator <code>filename!</code></li>
  <li>disable warning by using <code>#pragma warning disable CS8604 // Possible null reference argument.</code></li>
  <li>add another check for null <code>if(string == null || string.IsNullOrWhitespace(filename))</code></li>
  </ul>
  
  <p>But none of the seems satisfactory, mainly because I'll need to repeat the workaround for each call to <code>IsNullOrEmpty</code>.</p>
  
  <p>Is there any other way to tell the compiler that IsNullOrEmpty effectively guards against null ?</p>