<div><div>I am assuming Never is the subtype of all types, because any function regardless of it&#39;s return type, including Void, can return Never. </div></div><div><br><div class="gmail_quote"><div>On Fri, 13 Jan 2017 at 6:32 pm, Pierre Monod-Broca &lt;<a href="mailto:pierremonodbroca@gmail.com">pierremonodbroca@gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_msg"><div class="gmail_msg">@Howard</div><div id="m_7696160504370319786AppleMailSignature" class="gmail_msg">I was thinking the same about the constraint.</div><div id="m_7696160504370319786AppleMailSignature" class="gmail_msg"><br class="gmail_msg"></div><div id="m_7696160504370319786AppleMailSignature" class="gmail_msg">Does that mean that Never should be a subtype of Error (maybe it is already) ? Else you couldn&#39;t say throws(Never) or FSTore&lt;Never&gt;</div><div id="m_7696160504370319786AppleMailSignature" class="gmail_msg"><br class="gmail_msg"></div><div id="m_7696160504370319786AppleMailSignature" class="gmail_msg">@Howard</div><div id="m_7696160504370319786AppleMailSignature" class="gmail_msg">I&#39;m not sure about &lt;&gt;, it should stay reserved for generics, IMHO.</div></div><div class="gmail_msg"><div id="m_7696160504370319786AppleMailSignature" class="gmail_msg"><br class="gmail_msg">Pierre</div></div><div class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg">Le 13 janv. 2017 à 01:11, Howard Lovatt via swift-users &lt;<a href="mailto:swift-users@swift.org" class="gmail_msg" target="_blank">swift-users@swift.org</a>&gt; a écrit :<br class="gmail_msg"><br class="gmail_msg"></div><blockquote type="cite" class="gmail_msg"><div class="gmail_msg"><div class="gmail_msg">@Anton, Yes that would work and we would get typed throws, which I like. As an aside, I think E would have to be constrained to be an Error, `&lt;E: Error&gt;`, and maybe `throws&lt;E&gt;` reads better because you are used to types in angle brackets.</div><div class="gmail_extra gmail_msg"><br clear="all" class="gmail_msg"><div class="gmail_msg"><div class="m_7696160504370319786gmail_signature gmail_msg" data-smartmail="gmail_signature">  -- Howard.<br class="gmail_msg"></div></div><br><br><br class="gmail_msg"><div class="gmail_quote gmail_msg">On 13 January 2017 at 08:32, Anton Zhilin <span class="gmail_msg">&lt;<a href="mailto:antonyzhilin@gmail.com" class="gmail_msg" target="_blank">antonyzhilin@gmail.com</a>&gt;</span> wrote:<br class="gmail_msg"><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_msg"><div class="m_7696160504370319786m_6825551795680594501markdown-here-wrapper gmail_msg"><p style="margin:0px 0px 1.2em!important" class="gmail_msg">The best way to deal with such situations should be typed throws. Then <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline" class="gmail_msg">rethrows</code> should be removed and replaced with generics in <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline" class="gmail_msg">throws</code> clause. <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline" class="gmail_msg">E == Never</code> ⇔ function does not throw.</p><br><br><pre style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;font-size:1em;line-height:1.2em;margin:1.2em 0px" class="gmail_msg"><code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline;white-space:pre-wrap;overflow:auto;border-radius:3px;border:1px solid rgb(204,204,204);padding:0.5em 0.7em;display:block!important" class="gmail_msg">struct FStore&lt;E&gt; {<br><br>    let f: () throws(E) -&gt; Void<br><br>    init(_ f: @escaping () throws(E) -&gt; Void) { self.f = f }<br><br>    func call() throws(E) { try f() }<br><br>}<br><br><br><br>let store = FStore&lt;Never&gt;({ print(&quot;Hello&quot;) })<br><br>store.call()<br><br></code></pre><p style="margin:0px 0px 1.2em!important" class="gmail_msg">[Phase2]</p><br><br><div title="MDH:VGhlIGJlc3Qgd2F5IHRvIGRlYWwgd2l0aCBzdWNoIHNpdHVhdGlvbnMgc2hvdWxkIGJlIHR5cGVk&lt;br&gt;&lt;br&gt;IHRocm93cy4gVGhlbiBgcmV0aHJvd3NgIHNob3VsZCBiZSByZW1vdmVkIGFuZCByZXBsYWNlZCB3&lt;br&gt;&lt;br&gt;aXRoIGdlbmVyaWNzIGluIGB0aHJvd3NgIGNsYXVzZS4gYEUgPT0gTmV2ZXJgwqDih5QgZnVuY3Rp&lt;br&gt;&lt;br&gt;b24gZG9lcyBub3QgdGhyb3cuPGRpdj48YnI+PC9kaXY+PGRpdj5gYGA8L2Rpdj48ZGl2PnN0cnVj&lt;br&gt;&lt;br&gt;dCBGU3RvcmUmbHQ7RSZndDsgezwvZGl2PjxkaXY+PHNwYW4gc3R5bGU9ImZvbnQtc2l6ZTogMTIu&lt;br&gt;&lt;br&gt;OHB4OyI+Jm5ic3A7ICZuYnNwOyBsZXQgZjogKCkgdGhyb3dzKEUpIC0mZ3Q7IFZvaWQ8L3NwYW4+&lt;br&gt;&lt;br&gt;PGJyIHN0eWxlPSJmb250LXNpemU6IDEyLjhweDsiPjxzcGFuIHN0eWxlPSJmb250LXNpemU6IDEy&lt;br&gt;&lt;br&gt;LjhweDsiPiZuYnNwOyAmbmJzcDsgaW5pdChfIGY6IEBlc2NhcGluZyAoKSB0aHJvd3MoRSkgLSZn&lt;br&gt;&lt;br&gt;dDsgVm9pZCkgeyBzZWxmLmYgPSBmIH08L3NwYW4+PGJyIHN0eWxlPSJmb250LXNpemU6IDEyLjhw&lt;br&gt;&lt;br&gt;eDsiPjxzcGFuIHN0eWxlPSJmb250LXNpemU6IDEyLjhweDsiPiZuYnNwOyAmbmJzcDsgZnVuYyBj&lt;br&gt;&lt;br&gt;YWxsKCkgdGhyb3dzKEUpIHsgdHJ5IGYoKSB9PC9zcGFuPjxicj48L2Rpdj48ZGl2PjxzcGFuIHN0&lt;br&gt;&lt;br&gt;eWxlPSJmb250LXNpemU6IDEyLjhweDsiPn08L3NwYW4+PC9kaXY+PGRpdj48YnI+PC9kaXY+PGRp&lt;br&gt;&lt;br&gt;dj5sZXQgc3RvcmUgPSBGU3RvcmUmbHQ7TmV2ZXImZ3Q7KHsgcHJpbnQoIkhlbGxvIikgfSk8L2Rp&lt;br&gt;&lt;br&gt;dj48ZGl2PnN0b3JlLmNhbGwoKTwvZGl2PjxkaXY+YGBgPC9kaXY+PGRpdj48YnI+PC9kaXY+PGRp&lt;br&gt;&lt;br&gt;dj5bUGhhc2UyXTwvZGl2Pg==" style="height:0;width:0;max-height:0;max-width:0;overflow:hidden;font-size:0em;padding:0;margin:0" class="gmail_msg">​</div></div></div><br><br></blockquote></div><br class="gmail_msg"></div><br><br></div></blockquote></div><div class="gmail_msg"><blockquote type="cite" class="gmail_msg"><div class="gmail_msg"><span class="gmail_msg">_______________________________________________</span><br class="gmail_msg"><span class="gmail_msg">swift-users mailing list</span><br class="gmail_msg"><span class="gmail_msg"><a href="mailto:swift-users@swift.org" class="gmail_msg" target="_blank">swift-users@swift.org</a></span><br class="gmail_msg"><span class="gmail_msg"><a href="https://lists.swift.org/mailman/listinfo/swift-users" class="gmail_msg" target="_blank">https://lists.swift.org/mailman/listinfo/swift-users</a></span><br class="gmail_msg"></div></blockquote></div></blockquote></div></div><div dir="ltr">-- <br></div><div data-smartmail="gmail_signature">-- Howard.</div>