<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Sure looks like one to me. In particular, it looks like <a href="https://bugs.swift.org/browse/SR-2729" class="">SR-2729</a>.</div><div class=""><br class=""></div><div class="">(I suspect this is because calling the method through the protocol generates a bit of wrapper code that then calls the original method; that wrapper code doesn’t have a location of its own.)</div><div class=""><br class=""></div><div class="">Sorry for the trouble,</div><div class="">Jordan</div><div class=""><br class=""></div><br class=""><div><blockquote type="cite" class=""><div class="">On Jun 2, 2017, at 08:48, Rudolf Adamkovič via swift-users <<a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=us-ascii" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><p style="margin: 0px 0px 1em; padding: 0px; border: 0px; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 15px; line-height: inherit; vertical-align: baseline; clear: both; color: rgb(36, 39, 41);" class="">I'm trying to understand "Will never be executed" warning here:</p><pre class="lang-swift prettyprinted prettyprint" style="margin-top: 0px; margin-bottom: 1em; padding: 5px; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; font-size: 13px; line-height: inherit; vertical-align: baseline; width: auto; max-height: 600px; overflow: auto; background-color: rgb(239, 240, 241); color: rgb(57, 51, 24); word-wrap: normal;"><code style="margin: 0px; padding: 0px; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; font-style: inherit; font-variant-caps: inherit; line-height: inherit; vertical-align: baseline; white-space: inherit;" class=""><span class="kwd" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; line-height: inherit; vertical-align: baseline; color: rgb(16, 16, 148);">protocol</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; line-height: inherit; vertical-align: baseline; color: rgb(48, 51, 54);"> </span><span class="typ" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; line-height: inherit; vertical-align: baseline; color: rgb(43, 145, 175);">FatalErrorReporterInterface</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; line-height: inherit; vertical-align: baseline; color: rgb(48, 51, 54);"> </span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; line-height: inherit; vertical-align: baseline; color: rgb(48, 51, 54);">{</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; line-height: inherit; vertical-align: baseline; color: rgb(48, 51, 54);">
</span><span class="kwd" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; line-height: inherit; vertical-align: baseline; color: rgb(16, 16, 148);">func</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; line-height: inherit; vertical-align: baseline; color: rgb(48, 51, 54);"> fail</span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; line-height: inherit; vertical-align: baseline; color: rgb(48, 51, 54);">(_</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; line-height: inherit; vertical-align: baseline; color: rgb(48, 51, 54);"> message</span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; line-height: inherit; vertical-align: baseline; color: rgb(48, 51, 54);">:</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; line-height: inherit; vertical-align: baseline; color: rgb(48, 51, 54);"> </span><span class="typ" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; line-height: inherit; vertical-align: baseline; color: rgb(43, 145, 175);">String</span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; line-height: inherit; vertical-align: baseline; color: rgb(48, 51, 54);">)</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; line-height: inherit; vertical-align: baseline; color: rgb(48, 51, 54);"> </span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; line-height: inherit; vertical-align: baseline; color: rgb(48, 51, 54);">-></span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; line-height: inherit; vertical-align: baseline; color: rgb(48, 51, 54);"> </span><span class="typ" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; line-height: inherit; vertical-align: baseline; color: rgb(43, 145, 175);">Never</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; line-height: inherit; vertical-align: baseline; color: rgb(48, 51, 54);">
</span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; line-height: inherit; vertical-align: baseline; color: rgb(48, 51, 54);">}</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; line-height: inherit; vertical-align: baseline; color: rgb(48, 51, 54);">
</span><span class="kwd" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; line-height: inherit; vertical-align: baseline; color: rgb(16, 16, 148);">final</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; line-height: inherit; vertical-align: baseline; color: rgb(48, 51, 54);"> </span><span class="kwd" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; line-height: inherit; vertical-align: baseline; color: rgb(16, 16, 148);">class</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; line-height: inherit; vertical-align: baseline; color: rgb(48, 51, 54);"> </span><span class="typ" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; line-height: inherit; vertical-align: baseline; color: rgb(43, 145, 175);">FatalErrorReporter</span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; line-height: inherit; vertical-align: baseline; color: rgb(48, 51, 54);">:</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; line-height: inherit; vertical-align: baseline; color: rgb(48, 51, 54);"> </span><span class="typ" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; line-height: inherit; vertical-align: baseline; color: rgb(43, 145, 175);">FatalErrorReporterInterface</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; line-height: inherit; vertical-align: baseline; color: rgb(48, 51, 54);"> </span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; line-height: inherit; vertical-align: baseline; color: rgb(48, 51, 54);">{</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; line-height: inherit; vertical-align: baseline; color: rgb(48, 51, 54);">
</span><span class="com" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; line-height: inherit; vertical-align: baseline; color: rgb(133, 140, 147);">// This line emits "Will never be executed" warning
</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; line-height: inherit; vertical-align: baseline; color: rgb(48, 51, 54);"> </span><span class="kwd" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; line-height: inherit; vertical-align: baseline; color: rgb(16, 16, 148);">func</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; line-height: inherit; vertical-align: baseline; color: rgb(48, 51, 54);"> fail</span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; line-height: inherit; vertical-align: baseline; color: rgb(48, 51, 54);">(_</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; line-height: inherit; vertical-align: baseline; color: rgb(48, 51, 54);"> message</span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; line-height: inherit; vertical-align: baseline; color: rgb(48, 51, 54);">:</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; line-height: inherit; vertical-align: baseline; color: rgb(48, 51, 54);"> </span><span class="typ" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; line-height: inherit; vertical-align: baseline; color: rgb(43, 145, 175);">String</span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; line-height: inherit; vertical-align: baseline; color: rgb(48, 51, 54);">)</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; line-height: inherit; vertical-align: baseline; color: rgb(48, 51, 54);"> </span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; line-height: inherit; vertical-align: baseline; color: rgb(48, 51, 54);">-></span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; line-height: inherit; vertical-align: baseline; color: rgb(48, 51, 54);"> </span><span class="typ" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; line-height: inherit; vertical-align: baseline; color: rgb(43, 145, 175);">Never</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; line-height: inherit; vertical-align: baseline; color: rgb(48, 51, 54);"> </span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; line-height: inherit; vertical-align: baseline; color: rgb(48, 51, 54);">{</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; line-height: inherit; vertical-align: baseline; color: rgb(48, 51, 54);">
fatalError</span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; line-height: inherit; vertical-align: baseline; color: rgb(48, 51, 54);">(</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; line-height: inherit; vertical-align: baseline; color: rgb(48, 51, 54);">message</span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; line-height: inherit; vertical-align: baseline; color: rgb(48, 51, 54);">)</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; line-height: inherit; vertical-align: baseline; color: rgb(48, 51, 54);">
</span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; line-height: inherit; vertical-align: baseline; color: rgb(48, 51, 54);">}</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; line-height: inherit; vertical-align: baseline; color: rgb(48, 51, 54);">
</span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; line-height: inherit; vertical-align: baseline; color: rgb(48, 51, 54);">}</span></code></pre><p style="margin: 0px 0px 1em; padding: 0px; border: 0px; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 15px; line-height: inherit; vertical-align: baseline; clear: both; color: rgb(36, 39, 41);" class="">Yet another compiler bug?</p><div class=""><a href="https://stackoverflow.com/questions/44332850/mysterious-will-never-be-executed-warning" class="">https://stackoverflow.com/questions/44332850/mysterious-will-never-be-executed-warning</a></div><div class=""><br class=""></div><div class="">R+</div></div>_______________________________________________<br class="">swift-users mailing list<br class=""><a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-users<br class=""></div></blockquote></div><br class=""></body></html>