<div dir="ltr"><font size="4"><b>Introduction</b></font><div><div><br></div><div>This function was introduced along others to halt execution of the running instance to convey a state of affairs without resolution whatsoever. This proposal lays the case that this function is not performing its stated mission and attempts to help it come forward with its real intentions in order to have a better conformance with the Swift naming guidelines.</div><div><br></div><div><font size="4"><b>Motivation</b></font></div><div><br></div><div>The main motivation to this proposal is to act as a catalyst for the community to acknowledge the identity of this function and stay true to the values bestowed upon us by Chris Lattner and his disciples, the Core Team.</div></div><div><br></div><div>As evidenced in a quick search over a the great repository of <a href="https://github.com/search?l=Swift&q=fatalError%28%29&type=Code&utf8=✓">Gitxandria</a> we are witness to several examples of the true calling of fatalError(). A few examples are cited below for those who receive this letter in print.</div><div><br></div><div><p style="margin:0px;font-size:14px;line-height:normal;font-family:menlo;color:rgb(0,132,0)"><span style="font-variant-ligatures:no-common-ligatures">//Example 1</span></p><p style="margin:0px;font-size:14px;line-height:normal;font-family:menlo;color:rgb(187,44,162)"><span style="font-variant-ligatures:no-common-ligatures">switch</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(79,129,135)">result</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> {</span></p><p style="margin:0px;font-size:14px;line-height:normal;font-family:menlo"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(187,44,162)">case</span><span style="font-variant-ligatures:no-common-ligatures"> .</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(49,89,93)">Success</span><span style="font-variant-ligatures:no-common-ligatures">(let response):</span></p><p style="margin:0px;font-size:14px;line-height:normal;font-family:menlo;color:rgb(209,47,27)"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(61,29,129)">print</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">(</span><span style="font-variant-ligatures:no-common-ligatures">"Today's horoscope is: </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">\</span><span style="font-variant-ligatures:no-common-ligatures">(</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">response</span><span style="font-variant-ligatures:no-common-ligatures">)"</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">)</span></p><p style="margin:0px;font-size:14px;line-height:normal;font-family:menlo;color:rgb(187,44,162)"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> </span><span style="font-variant-ligatures:no-common-ligatures">break</span></p><p style="margin:0px;font-size:14px;line-height:normal;font-family:menlo"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(187,44,162)">case</span><span style="font-variant-ligatures:no-common-ligatures"> .</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(49,89,93)">Failure</span><span style="font-variant-ligatures:no-common-ligatures">(let error):</span></p><p style="margin:0px;font-size:14px;line-height:normal;font-family:menlo;color:rgb(209,47,27)"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(61,29,129)">fatalError</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">(</span><span style="font-variant-ligatures:no-common-ligatures">"Present </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">\</span><span style="font-variant-ligatures:no-common-ligatures">(</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">error</span><span style="font-variant-ligatures:no-common-ligatures">) to user"</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">)</span></p><p style="margin:0px;font-size:14px;line-height:normal;font-family:menlo"><span style="font-variant-ligatures:no-common-ligatures">}</span></p><p style="margin:0px;font-size:14px;line-height:normal;font-family:menlo;min-height:16px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></p><p style="margin:0px;font-size:14px;line-height:normal;font-family:menlo;color:rgb(0,132,0)"><span style="font-variant-ligatures:no-common-ligatures">//Example 2</span></p><p style="margin:0px;font-size:14px;line-height:normal;font-family:menlo"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(187,44,162)">func</span><span style="font-variant-ligatures:no-common-ligatures"> cell(at index: </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(112,61,170)">Int</span><span style="font-variant-ligatures:no-common-ligatures">) -> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(79,129,135)">Cell</span><span style="font-variant-ligatures:no-common-ligatures"> {</span></p><p style="margin:0px;font-size:14px;line-height:normal;font-family:menlo"><span style="font-variant-ligatures:no-common-ligatures"> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(187,44,162)">if</span><span style="font-variant-ligatures:no-common-ligatures"> (</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(39,42,216)">0</span><span style="font-variant-ligatures:no-common-ligatures">..<</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(39,42,216)">10</span><span style="font-variant-ligatures:no-common-ligatures">).</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(61,29,129)">contains</span><span style="font-variant-ligatures:no-common-ligatures">(index) {</span></p><p style="margin:0px;font-size:14px;line-height:normal;font-family:menlo"><span style="font-variant-ligatures:no-common-ligatures"> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(187,44,162)">return</span><span style="font-variant-ligatures:no-common-ligatures"> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(79,129,135)">Cell</span><span style="font-variant-ligatures:no-common-ligatures">(</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(79,129,135)">horses</span><span style="font-variant-ligatures:no-common-ligatures">[index])</span></p><p style="margin:0px;font-size:14px;line-height:normal;font-family:menlo"><span style="font-variant-ligatures:no-common-ligatures"> }</span></p><p style="margin:0px;font-size:14px;line-height:normal;font-family:menlo"><span style="font-variant-ligatures:no-common-ligatures"> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(187,44,162)">if</span><span style="font-variant-ligatures:no-common-ligatures"> (</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(39,42,216)">10</span><span style="font-variant-ligatures:no-common-ligatures">..<</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(39,42,216)">20</span><span style="font-variant-ligatures:no-common-ligatures">).</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(61,29,129)">contains</span><span style="font-variant-ligatures:no-common-ligatures">(index) {</span></p><p style="margin:0px;font-size:14px;line-height:normal;font-family:menlo"><span style="font-variant-ligatures:no-common-ligatures"> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(187,44,162)">return</span><span style="font-variant-ligatures:no-common-ligatures"> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(79,129,135)">Cell</span><span style="font-variant-ligatures:no-common-ligatures">(</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(79,129,135)">ponies</span><span style="font-variant-ligatures:no-common-ligatures">[index])</span></p><p style="margin:0px;font-size:14px;line-height:normal;font-family:menlo"><span style="font-variant-ligatures:no-common-ligatures"> }</span></p><p style="margin:0px;font-size:14px;line-height:normal;font-family:menlo;min-height:16px"><span style="font-variant-ligatures:no-common-ligatures"> </span></p><p style="margin:0px;font-size:14px;line-height:normal;font-family:menlo;color:rgb(209,47,27)"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(61,29,129)">fatalError</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">(</span><span style="font-variant-ligatures:no-common-ligatures">"Unicorns go here"</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">)</span></p><p style="margin:0px;font-size:14px;line-height:normal;font-family:menlo">
</p><p style="margin:0px;font-size:14px;line-height:normal;font-family:menlo"><span style="font-variant-ligatures:no-common-ligatures">}</span></p><p style="margin:0px;font-size:14px;line-height:normal;font-family:menlo"><span style="font-variant-ligatures:no-common-ligatures"><br></span></p><p style="margin:0px;font-size:14px;line-height:normal;font-family:menlo"><span style="font-family:arial,sans-serif;font-size:small">As seen in the previous examples, the calling of fatalError is seldom that.</span></p><p style="margin:0px;font-size:14px;line-height:normal;font-family:menlo"><span style="font-family:arial,sans-serif;font-size:small"><br></span></p><p style="margin:0px;line-height:normal;font-family:menlo"><span style="font-size:small;font-family:arial,sans-serif"> </span><b style="font-family:arial,sans-serif"><font size="4">Proposed solution</font></b><br></p><p style="margin:0px;line-height:normal;font-family:menlo"><b style="font-family:arial,sans-serif"><font size="4"><br></font></b></p><p style="margin:0px;line-height:normal">The proposed solution is to rename `fatalError(_ message: String)` to `willItToCompile(finishLater: String)` to convey the right terminology for it's calling. Here are the revised examples:</p><p style="margin:0px;line-height:normal"><br></p><p style="margin:0px;font-size:14px;line-height:normal;font-family:menlo;color:rgb(0,132,0)"><span style="font-variant-ligatures:no-common-ligatures">//Example 1</span></p><p style="margin:0px;font-size:14px;line-height:normal;font-family:menlo;color:rgb(187,44,162)"><span style="font-variant-ligatures:no-common-ligatures">switch</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(79,129,135)">result</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> {</span></p><p style="margin:0px;font-size:14px;line-height:normal;font-family:menlo"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(187,44,162)">case</span><span style="font-variant-ligatures:no-common-ligatures"> .</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(49,89,93)">Success</span><span style="font-variant-ligatures:no-common-ligatures">(let response):</span></p><p style="margin:0px;font-size:14px;line-height:normal;font-family:menlo;color:rgb(209,47,27)"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(61,29,129)">print</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">(</span><span style="font-variant-ligatures:no-common-ligatures">"Today's horoscope is: </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">\</span><span style="font-variant-ligatures:no-common-ligatures">(</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">response</span><span style="font-variant-ligatures:no-common-ligatures">)"</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">)</span></p><p style="margin:0px;font-size:14px;line-height:normal;font-family:menlo;color:rgb(187,44,162)"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> </span><span style="font-variant-ligatures:no-common-ligatures">break</span></p><p style="margin:0px;font-size:14px;line-height:normal;font-family:menlo"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(187,44,162)">case</span><span style="font-variant-ligatures:no-common-ligatures"> .</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(49,89,93)">Failure</span><span style="font-variant-ligatures:no-common-ligatures">(let error):</span></p><p style="margin:0px;font-size:14px;line-height:normal;font-family:menlo"><span style="font-variant-ligatures:no-common-ligatures"> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(49,89,93)">willItToCompile</span><span style="font-variant-ligatures:no-common-ligatures">(finishLater: </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,47,27)">"Present </span><span style="font-variant-ligatures:no-common-ligatures">\</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,47,27)">(</span><span style="font-variant-ligatures:no-common-ligatures">error</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,47,27)">) to user"</span><span style="font-variant-ligatures:no-common-ligatures">)</span></p><p style="margin:0px;font-size:14px;line-height:normal;font-family:menlo"><span style="font-variant-ligatures:no-common-ligatures">}</span></p><p style="margin:0px;font-size:14px;line-height:normal;font-family:menlo;min-height:16px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></p><p style="margin:0px;font-size:14px;line-height:normal;font-family:menlo;color:rgb(0,132,0)"><span style="font-variant-ligatures:no-common-ligatures">//Example 2</span></p><p style="margin:0px;font-size:14px;line-height:normal;font-family:menlo"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(187,44,162)">func</span><span style="font-variant-ligatures:no-common-ligatures"> cell(at index: </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(112,61,170)">Int</span><span style="font-variant-ligatures:no-common-ligatures">) -> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(79,129,135)">Cell</span><span style="font-variant-ligatures:no-common-ligatures"> {</span></p><p style="margin:0px;font-size:14px;line-height:normal;font-family:menlo"><span style="font-variant-ligatures:no-common-ligatures"> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(187,44,162)">if</span><span style="font-variant-ligatures:no-common-ligatures"> (</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(39,42,216)">0</span><span style="font-variant-ligatures:no-common-ligatures">..<</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(39,42,216)">10</span><span style="font-variant-ligatures:no-common-ligatures">).</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(61,29,129)">contains</span><span style="font-variant-ligatures:no-common-ligatures">(index) {</span></p><p style="margin:0px;font-size:14px;line-height:normal;font-family:menlo"><span style="font-variant-ligatures:no-common-ligatures"> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(187,44,162)">return</span><span style="font-variant-ligatures:no-common-ligatures"> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(79,129,135)">Cell</span><span style="font-variant-ligatures:no-common-ligatures">(</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(79,129,135)">horses</span><span style="font-variant-ligatures:no-common-ligatures">[index])</span></p><p style="margin:0px;font-size:14px;line-height:normal;font-family:menlo"><span style="font-variant-ligatures:no-common-ligatures"> }</span></p><p style="margin:0px;font-size:14px;line-height:normal;font-family:menlo"><span style="font-variant-ligatures:no-common-ligatures"> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(187,44,162)">if</span><span style="font-variant-ligatures:no-common-ligatures"> (</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(39,42,216)">10</span><span style="font-variant-ligatures:no-common-ligatures">..<</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(39,42,216)">20</span><span style="font-variant-ligatures:no-common-ligatures">).</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(61,29,129)">contains</span><span style="font-variant-ligatures:no-common-ligatures">(index) {</span></p><p style="margin:0px;font-size:14px;line-height:normal;font-family:menlo"><span style="font-variant-ligatures:no-common-ligatures"> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(187,44,162)">return</span><span style="font-variant-ligatures:no-common-ligatures"> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(79,129,135)">Cell</span><span style="font-variant-ligatures:no-common-ligatures">(</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(79,129,135)">ponies</span><span style="font-variant-ligatures:no-common-ligatures">[index])</span></p><p style="margin:0px;font-size:14px;line-height:normal;font-family:menlo"><span style="font-variant-ligatures:no-common-ligatures"> }</span></p><p style="margin:0px;font-size:14px;line-height:normal;font-family:menlo;min-height:16px"><span style="font-variant-ligatures:no-common-ligatures"> </span></p><p style="margin:0px;font-size:14px;line-height:normal;font-family:menlo"><span style="font-variant-ligatures:no-common-ligatures"> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(49,89,93)">willItToCompile</span><span style="font-variant-ligatures:no-common-ligatures">(finishLater: </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,47,27)">"Unicorns go here"</span><span style="font-variant-ligatures:no-common-ligatures">)</span></p><p style="margin:0px;line-height:normal">
</p><p style="margin:0px;font-size:14px;line-height:normal;font-family:menlo"><span style="font-variant-ligatures:no-common-ligatures">}</span></p><p style="margin:0px;font-size:14px;line-height:normal;font-family:menlo"><span style="font-variant-ligatures:no-common-ligatures"><br></span></p><p style="margin:0px;font-size:14px;line-height:normal;font-family:menlo"><span style="font-family:arial,sans-serif;font-size:small">As you can see, the intent of this code is clearer and the true meaning of the developer is revealed. </span><br></p><p style="margin:0px;font-size:14px;line-height:normal;font-family:menlo"><span style="font-family:arial,sans-serif;font-size:small"><br></span></p><p style="margin:0px;font-size:14px;line-height:normal;font-family:menlo"><span style="font-size:small;font-family:arial,sans-serif"> </span><b style="font-family:arial,sans-serif"><font size="4">Source Compatibility</font></b><span style="font-family:arial,sans-serif;font-size:small"><br></span></p><p style="margin:0px;font-size:14px;line-height:normal;font-family:menlo"><b style="font-family:arial,sans-serif"><font size="4"><br></font></b></p><p style="margin:0px;line-height:normal">This is an important issue, we must stand to this shameful tradition and break it. Functions deserve to be called by their purest and true identity, we are still within the window of source breaking changes so there is no better time, the time is now! </p><p style="margin:0px;font-size:14px;line-height:normal;font-family:menlo"><span style="font-family:arial,sans-serif;font-size:small"><br></span></p><p style="margin:0px;font-size:14px;line-height:normal;font-family:menlo"><b style="font-family:arial,sans-serif"><font size="4">Alternatives considered</font></b></p><p style="margin:0px;font-size:14px;line-height:normal;font-family:menlo"><b style="font-family:arial,sans-serif"><font size="4"><br></font></b></p><p style="margin:0px;line-height:normal">Keep calling it the same shameful name to an innocent function who has done nothing but bring us joy to our development cycles and help us throughout hard times.</p><p style="margin:0px;line-height:normal"><br></p><p style="margin:0px;line-height:normal"><br></p><p style="margin:0px;line-height:normal">------</p><p style="margin:0px;line-height:normal"><font size="4">Merry Christmas and</font></p><p style="margin:0px;line-height:normal"><font size="4">Happy New Year</font></p></div></div>