<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>@Howard</div><div id="AppleMailSignature">I was thinking the same about the constraint.</div><div id="AppleMailSignature"><br></div><div id="AppleMailSignature">Does that mean that Never should be a subtype of Error (maybe it is already) ? Else you couldn't say throws(Never) or FSTore&lt;Never&gt;</div><div id="AppleMailSignature"><br></div><div id="AppleMailSignature">@Howard</div><div id="AppleMailSignature">I'm not sure about &lt;&gt;, it should stay reserved for generics, IMHO.</div><div id="AppleMailSignature"><br>Pierre</div><div><br>Le 13 janv. 2017 à 01:11, Howard Lovatt via swift-users &lt;<a href="mailto:swift-users@swift.org">swift-users@swift.org</a>&gt; a écrit&nbsp;:<br><br></div><blockquote type="cite"><div><div dir="ltr">@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"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature">&nbsp; -- Howard.<br></div></div>
<br><div class="gmail_quote">On 13 January 2017 at 08:32, Anton Zhilin <span dir="ltr">&lt;<a href="mailto:antonyzhilin@gmail.com" target="_blank">antonyzhilin@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="m_6825551795680594501markdown-here-wrapper"><p style="margin:0px 0px 1.2em!important">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">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">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">E == Never</code> ⇔ function does not throw.</p>
<pre style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;font-size:1em;line-height:1.2em;margin:1.2em 0px"><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">struct FStore&lt;E&gt; {
    let f: () throws(E) -&gt; Void
    init(_ f: @escaping () throws(E) -&gt; Void) { self.f = f }
    func call() throws(E) { try f() }
}

let store = FStore&lt;Never&gt;({ print("Hello") })
store.call()
</code></pre><p style="margin:0px 0px 1.2em!important">[Phase2]</p>
<div title="MDH:VGhlIGJlc3Qgd2F5IHRvIGRlYWwgd2l0aCBzdWNoIHNpdHVhdGlvbnMgc2hvdWxkIGJlIHR5cGVk
IHRocm93cy4gVGhlbiBgcmV0aHJvd3NgIHNob3VsZCBiZSByZW1vdmVkIGFuZCByZXBsYWNlZCB3
aXRoIGdlbmVyaWNzIGluIGB0aHJvd3NgIGNsYXVzZS4gYEUgPT0gTmV2ZXJgwqDih5QgZnVuY3Rp
b24gZG9lcyBub3QgdGhyb3cuPGRpdj48YnI+PC9kaXY+PGRpdj5gYGA8L2Rpdj48ZGl2PnN0cnVj
dCBGU3RvcmUmbHQ7RSZndDsgezwvZGl2PjxkaXY+PHNwYW4gc3R5bGU9ImZvbnQtc2l6ZTogMTIu
OHB4OyI+Jm5ic3A7ICZuYnNwOyBsZXQgZjogKCkgdGhyb3dzKEUpIC0mZ3Q7IFZvaWQ8L3NwYW4+
PGJyIHN0eWxlPSJmb250LXNpemU6IDEyLjhweDsiPjxzcGFuIHN0eWxlPSJmb250LXNpemU6IDEy
LjhweDsiPiZuYnNwOyAmbmJzcDsgaW5pdChfIGY6IEBlc2NhcGluZyAoKSB0aHJvd3MoRSkgLSZn
dDsgVm9pZCkgeyBzZWxmLmYgPSBmIH08L3NwYW4+PGJyIHN0eWxlPSJmb250LXNpemU6IDEyLjhw
eDsiPjxzcGFuIHN0eWxlPSJmb250LXNpemU6IDEyLjhweDsiPiZuYnNwOyAmbmJzcDsgZnVuYyBj
YWxsKCkgdGhyb3dzKEUpIHsgdHJ5IGYoKSB9PC9zcGFuPjxicj48L2Rpdj48ZGl2PjxzcGFuIHN0
eWxlPSJmb250LXNpemU6IDEyLjhweDsiPn08L3NwYW4+PC9kaXY+PGRpdj48YnI+PC9kaXY+PGRp
dj5sZXQgc3RvcmUgPSBGU3RvcmUmbHQ7TmV2ZXImZ3Q7KHsgcHJpbnQoIkhlbGxvIikgfSk8L2Rp
dj48ZGl2PnN0b3JlLmNhbGwoKTwvZGl2PjxkaXY+YGBgPC9kaXY+PGRpdj48YnI+PC9kaXY+PGRp
dj5bUGhhc2UyXTwvZGl2Pg==" style="height:0;width:0;max-height:0;max-width:0;overflow:hidden;font-size:0em;padding:0;margin:0">​</div></div></div>
</blockquote></div><br></div>
</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>swift-users mailing list</span><br><span><a href="mailto:swift-users@swift.org">swift-users@swift.org</a></span><br><span><a href="https://lists.swift.org/mailman/listinfo/swift-users">https://lists.swift.org/mailman/listinfo/swift-users</a></span><br></div></blockquote></body></html>