title: What is the Never return type?
body: <p>What does a <code>func</code> with return type <code>Never</code> do?</p>
  
  <p>For example:</p>
  
  <pre class="lang-swift prettyprint-override"><code>func addNums() -&gt; Never {
  
      //my code
  
  }
  </code></pre>
  
  <p>What will be the difference if I kept the return type as <code>Void</code> like this?</p>
  
  <pre><code>func addNums() -&gt; Void {
  
      //my code
  
  }
  </code></pre>
  
  <hr>
  
  <p>Suppose I wish to handle a <code>fatalError</code> (as said by <a href="https://stackoverflow.com/users/603989/dpassage">dpassage</a>); the below code will be sufficient:</p>
  
  <pre><code>print("its an error")
  return
  </code></pre>
  
  <p>Apple documentation says:</p>
  
  <blockquote>
    <p>The return type of functions that do not return normally, that is, a type with no values.</p>
  </blockquote>
  
  <p><sup>Source: <a href="https://developer.apple.com/documentation/swift/never" rel="noreferrer">Developer</a></sup></p>
  
  <p>This was not a duplicate question of <a href="https://stackoverflow.com/q/38098608/3939277">When and how to use @noreturn attribute in Swift?</a>, as I wish for a more detailed answer which needs details like:</p>
  
  <ol>
  <li><p>Practical examples on the difference between both <code>Never</code> and <code>Void</code> as return types</p></li>
  <li><p>Condition by which we should adopt these return types.</p></li>
  <li><p>Also there is a chance the return type can be nil; I need a comparison of that feature too</p></li>
  </ol>
  
  <p>The answer should focus on the differences.</p>