title: Visual Studio 2017 15.3 Simplifying null check
body: <p>I have this code:</p>
  
  <pre><code>public UnityResolver(IUnityContainer container)
  {
     if (container == null) throw new ArgumentNullException("container");
     _container = container;
  }
  </code></pre>
  
  <p>Visual Studio shows 3 grey dots and suggests to simplify the null check.</p>
  
  <p>It makes the method this:</p>
  
  <pre><code>_container = container ?? throw new ArgumentNullException("container");
  </code></pre>
  
  <p>That don't build...</p>
  
  <p>What's going on here? Why does it think it can simplify this and why is it simplifying it to something that doesn't build.</p>
  
  <p>The error is gives is:</p>
  
  <pre><code>1&gt;L:\SL1-(SentiLAN)-SentiLAN v1 - Current System\SentilanCore\WEB API with Plugins\APITest2\App_Start\UnityConfig.cs(31,39,31,44): error CS1525: Invalid expression term 'throw'
  1&gt;L:\SL1-(SentiLAN)-SentiLAN v1 - Current System\SentilanCore\WEB API with Plugins\APITest2\App_Start\UnityConfig.cs(31,39,31,44): error CS1002: ; expected
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/3C3iu.png" rel="noreferrer"><img src="https://i.stack.imgur.com/3C3iu.png" alt="enter image description here"></a></p>