title: Resolve compilation error “CS8601 Possible null reference assignment”
body: <p>Since C# 8.0, the standard is non nullable variable by default. <a href="https://endjin.com/blog/2020/04/dotnet-csharp-8-nullable-references-non-nullable-is-the-new-default" rel="noreferrer">Ref1</a></p>
  <p>But in case of generics like this one:</p>
  <pre><code>    public static T PerfomIO&lt;T&gt;(Func&lt;T&gt; function, T defaultValue = default)
      {
          try
          {
              return function();
          }
          catch (IOException)
          {
          }
  
          return defaultValue;
      }
  </code></pre>
  <p>How to get rid of the compilation error &quot;CS8601 Possible null reference assignement&quot; that occur when I try to pass &quot;default&quot; ?</p>
  <p>I want to support null value here. I do not want to disable the error message. I want to program it the way it should be.</p>
  <p>I try to add Nullable in many ways without success.
  I try [AllowNull] without success</p>
  <p><a href="https://i.stack.imgur.com/CzKrx.png" rel="noreferrer"><img src="https://i.stack.imgur.com/CzKrx.png" alt="enter image description here" /></a></p>