<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=""><blockquote type="cite" class="">On Aug 28, 2016, at 3:44 AM, Bouke Haarsma via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:<br class=""></blockquote><div><blockquote type="cite" class=""><br class="Apple-interchange-newline"><div class=""><div style="margin: 0px; font-style: normal; font-variant-caps: normal; font-weight: normal; font-size: 12px; line-height: normal; font-family: Helvetica; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">On 2016-08-26 15:39:05 +0000, Félix Cloutier via swift-evolution said:</div><div style="margin: 0px; font-style: normal; font-variant-caps: normal; font-weight: normal; font-size: 12px; line-height: normal; font-family: Helvetica; min-height: 14px; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class=""></div><div style="margin: 0px 0px 0px 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; font-size: 12px; line-height: normal; font-family: Helvetica; color: rgb(1, 24, 146); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">Hi all,</div><div style="margin: 0px 0px 0px 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; font-size: 12px; line-height: normal; font-family: Helvetica; color: rgb(1, 24, 146); min-height: 14px; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class=""></div><div style="margin: 0px 0px 0px 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; font-size: 12px; line-height: normal; font-family: Helvetica; color: rgb(1, 24, 146); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">Currently, a function that throws is assumed to throw anything. There was a proposal draft last December to restrict that. The general idea was that you'd write, for instance:</div><div style="margin: 0px 0px 0px 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; font-size: 12px; line-height: normal; font-family: Helvetica; color: rgb(1, 24, 146); min-height: 14px; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class=""></div><div style="margin: 0px 0px 0px 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; font-size: 12px; line-height: normal; font-family: Helvetica; color: rgb(1, 24, 146); min-height: 14px; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class=""></div><div style="margin: 0px 0px 0px 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; font-size: 12px; line-height: normal; font-family: Helvetica; color: rgb(1, 24, 146); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">enum Foo: ErrorProtocol {</div><div style="margin: 0px 0px 0px 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; font-size: 12px; line-height: normal; font-family: Helvetica; color: rgb(1, 24, 146); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">&nbsp; &nbsp;<span class="Apple-converted-space">&nbsp;</span>case bar</div><div style="margin: 0px 0px 0px 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; font-size: 12px; line-height: normal; font-family: Helvetica; color: rgb(1, 24, 146); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">&nbsp; &nbsp;<span class="Apple-converted-space">&nbsp;</span>case baz</div><div style="margin: 0px 0px 0px 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; font-size: 12px; line-height: normal; font-family: Helvetica; color: rgb(1, 24, 146); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">}</div><div style="margin: 0px 0px 0px 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; font-size: 12px; line-height: normal; font-family: Helvetica; color: rgb(1, 24, 146); min-height: 14px; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class=""></div><div style="margin: 0px 0px 0px 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; font-size: 12px; line-height: normal; font-family: Helvetica; color: rgb(1, 24, 146); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">func frob() throws Foo {</div><div style="margin: 0px 0px 0px 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; font-size: 12px; line-height: normal; font-family: Helvetica; color: rgb(1, 24, 146); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">&nbsp; &nbsp;<span class="Apple-converted-space">&nbsp;</span>throw Foo.bar // throw .bar?</div><div style="margin: 0px 0px 0px 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; font-size: 12px; line-height: normal; font-family: Helvetica; color: rgb(1, 24, 146); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">}</div><div style="margin: 0px 0px 0px 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; font-size: 12px; line-height: normal; font-family: Helvetica; color: rgb(1, 24, 146); min-height: 14px; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class=""></div><div style="margin: 0px 0px 0px 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; font-size: 12px; line-height: normal; font-family: Helvetica; color: rgb(1, 24, 146); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">If you `catch Foo` (or every case of Foo), now that the compiler can verify that your catch is exhaustive, you no longer have to have a catch-all block at the end of the sequence.</div><div style="margin: 0px 0px 0px 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; font-size: 12px; line-height: normal; font-family: Helvetica; color: rgb(1, 24, 146); min-height: 14px; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class=""></div><div style="margin: 0px 0px 0px 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; font-size: 12px; line-height: normal; font-family: Helvetica; color: rgb(1, 24, 146); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">This impacts the metadata format and has implications on resilience, which leads me to believe that the discussion could qualify for the phase 1 of Swift 4. If this is the case, I'd be interested in pulling out the old discussions and seeing where we left that at.</div><div style="margin: 0px 0px 0px 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; font-size: 12px; line-height: normal; font-family: Helvetica; color: rgb(1, 24, 146); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">Félix<span class="Apple-converted-space">&nbsp;</span></div><div style="margin: 0px 0px 0px 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; font-size: 12px; line-height: normal; font-family: Helvetica; color: rgb(1, 24, 146); min-height: 14px; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class=""></div><div style="margin: 0px 0px 0px 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; font-size: 12px; line-height: normal; font-family: Helvetica; color: rgb(1, 24, 146); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">_______________________________________________</div><div style="margin: 0px 0px 0px 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; font-size: 12px; line-height: normal; font-family: Helvetica; color: rgb(1, 24, 146); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">swift-evolution mailing list</div><div style="margin: 0px 0px 0px 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; font-size: 12px; line-height: normal; font-family: Helvetica; color: rgb(1, 24, 146); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a></div><div style="margin: 0px 0px 0px 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; font-size: 12px; line-height: normal; font-family: Helvetica; color: rgb(1, 24, 146); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a></div><div style="margin: 0px; font-style: normal; font-variant-caps: normal; font-weight: normal; font-size: 12px; line-height: normal; font-family: Helvetica; min-height: 14px; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class=""></div><div style="margin: 0px; font-style: normal; font-variant-caps: normal; font-weight: normal; font-size: 12px; line-height: normal; font-family: Helvetica; min-height: 14px; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class=""></div><div style="margin: 0px; font-style: normal; font-variant-caps: normal; font-weight: normal; font-size: 12px; line-height: normal; font-family: Helvetica; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span class="s1" style="">H</span>i,</div><div style="margin: 0px; font-style: normal; font-variant-caps: normal; font-weight: normal; font-size: 12px; line-height: normal; font-family: Helvetica; min-height: 14px; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class=""></div><div style="margin: 0px; font-style: normal; font-variant-caps: normal; font-weight: normal; font-size: 12px; line-height: normal; font-family: Helvetica; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">Shouldn't the compiler be able to infer the types thrown, and thus whether all types have been thrown? The general idea being that the following would be valid:</div><div style="margin: 0px; font-style: normal; font-variant-caps: normal; font-weight: normal; font-size: 12px; line-height: normal; font-family: Helvetica; min-height: 14px; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class=""></div><div style="margin: 0px; font-style: normal; font-variant-caps: normal; font-weight: normal; font-size: 11px; line-height: normal; font-family: Menlo; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span class="s2" style="font-variant-ligatures: no-common-ligatures; color: rgb(4, 51, 255);">enum</span><span class="s3" style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-converted-space">&nbsp;</span>Foo:<span class="Apple-converted-space">&nbsp;</span></span><span class="s4" style="font-variant-ligatures: no-common-ligatures; color: rgb(52, 149, 175);">Error</span><span class="s3" style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-converted-space">&nbsp;</span>{</span></div><div style="margin: 0px; font-style: normal; font-variant-caps: normal; font-weight: normal; font-size: 11px; line-height: normal; font-family: Menlo; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span class="s3" style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-converted-space">&nbsp; &nbsp;<span class="Apple-converted-space">&nbsp;</span></span></span><span class="s2" style="font-variant-ligatures: no-common-ligatures; color: rgb(4, 51, 255);">case</span><span class="s3" style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-converted-space">&nbsp;</span>bar</span></div><div style="margin: 0px; font-style: normal; font-variant-caps: normal; font-weight: normal; font-size: 11px; line-height: normal; font-family: Menlo; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span class="s3" style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-converted-space">&nbsp; &nbsp;<span class="Apple-converted-space">&nbsp;</span></span></span><span class="s2" style="font-variant-ligatures: no-common-ligatures; color: rgb(4, 51, 255);">case</span><span class="s3" style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-converted-space">&nbsp;</span>baz</span></div><div style="margin: 0px; font-style: normal; font-variant-caps: normal; font-weight: normal; font-size: 11px; line-height: normal; font-family: Menlo; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span class="s3" style="font-variant-ligatures: no-common-ligatures;">}</span></div><div style="margin: 0px; font-style: normal; font-variant-caps: normal; font-weight: normal; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span class="s3" style="font-variant-ligatures: no-common-ligatures;"></span><br class=""></div><div style="margin: 0px; font-style: normal; font-variant-caps: normal; font-weight: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 143, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span class="s2" style="font-variant-ligatures: no-common-ligatures; color: rgb(4, 51, 255);">func</span><span class="s5" style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-converted-space">&nbsp;</span>hello()<span class="Apple-converted-space">&nbsp;</span></span><span class="s2" style="font-variant-ligatures: no-common-ligatures; color: rgb(4, 51, 255);">throws</span><span class="s5" style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-converted-space">&nbsp;</span>{<span class="Apple-converted-space">&nbsp;</span></span><span class="s3" style="font-variant-ligatures: no-common-ligatures;">// inferred to throw only "Foo.bar"</span></div><div style="margin: 0px; font-style: normal; font-variant-caps: normal; font-weight: normal; font-size: 11px; line-height: normal; font-family: Menlo; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span class="s3" style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-converted-space">&nbsp; &nbsp;<span class="Apple-converted-space">&nbsp;</span></span></span><span class="s2" style="font-variant-ligatures: no-common-ligatures; color: rgb(4, 51, 255);">throw</span><span class="s3" style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-converted-space">&nbsp;</span></span><span class="s4" style="font-variant-ligatures: no-common-ligatures; color: rgb(52, 149, 175);">Foo</span><span class="s3" style="font-variant-ligatures: no-common-ligatures;">.</span><span class="s4" style="font-variant-ligatures: no-common-ligatures; color: rgb(52, 149, 175);">bar</span></div><div style="margin: 0px; font-style: normal; font-variant-caps: normal; font-weight: normal; font-size: 11px; line-height: normal; font-family: Menlo; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span class="s3" style="font-variant-ligatures: no-common-ligatures;">}</span></div><div style="margin: 0px; font-style: normal; font-variant-caps: normal; font-weight: normal; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span class="s3" style="font-variant-ligatures: no-common-ligatures;"></span><br class=""></div><div style="margin: 0px; font-style: normal; font-variant-caps: normal; font-weight: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 143, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span class="s2" style="font-variant-ligatures: no-common-ligatures; color: rgb(4, 51, 255);">func</span><span class="s5" style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-converted-space">&nbsp;</span>world()<span class="Apple-converted-space">&nbsp;</span></span><span class="s2" style="font-variant-ligatures: no-common-ligatures; color: rgb(4, 51, 255);">throws</span><span class="s5" style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-converted-space">&nbsp;</span>{<span class="Apple-converted-space">&nbsp;</span></span><span class="s3" style="font-variant-ligatures: no-common-ligatures;">// inferred to throw only "Foo.baz"</span></div><div style="margin: 0px; font-style: normal; font-variant-caps: normal; font-weight: normal; font-size: 11px; line-height: normal; font-family: Menlo; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span class="s3" style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-converted-space">&nbsp; &nbsp;<span class="Apple-converted-space">&nbsp;</span></span></span><span class="s2" style="font-variant-ligatures: no-common-ligatures; color: rgb(4, 51, 255);">throw</span><span class="s3" style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-converted-space">&nbsp;</span></span><span class="s4" style="font-variant-ligatures: no-common-ligatures; color: rgb(52, 149, 175);">Foo</span><span class="s3" style="font-variant-ligatures: no-common-ligatures;">.</span><span class="s4" style="font-variant-ligatures: no-common-ligatures; color: rgb(52, 149, 175);">baz</span></div><div style="margin: 0px; font-style: normal; font-variant-caps: normal; font-weight: normal; font-size: 11px; line-height: normal; font-family: Menlo; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span class="s3" style="font-variant-ligatures: no-common-ligatures;">}</span></div><div style="margin: 0px; font-style: normal; font-variant-caps: normal; font-weight: normal; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span class="s3" style="font-variant-ligatures: no-common-ligatures;"></span><br class=""></div><div style="margin: 0px; font-style: normal; font-variant-caps: normal; font-weight: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 143, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span class="s2" style="font-variant-ligatures: no-common-ligatures; color: rgb(4, 51, 255);">func</span><span class="s5" style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-converted-space">&nbsp;</span>galaxy()<span class="Apple-converted-space">&nbsp;</span></span><span class="s2" style="font-variant-ligatures: no-common-ligatures; color: rgb(4, 51, 255);">throws</span><span class="s5" style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-converted-space">&nbsp;</span>{<span class="Apple-converted-space">&nbsp;</span></span><span class="s3" style="font-variant-ligatures: no-common-ligatures;">// inferred to throw only "Foo.baz"</span></div><div style="margin: 0px; font-style: normal; font-variant-caps: normal; font-weight: normal; font-size: 11px; line-height: normal; font-family: Menlo; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span class="s3" style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-converted-space">&nbsp; &nbsp;<span class="Apple-converted-space">&nbsp;</span></span></span><span class="s2" style="font-variant-ligatures: no-common-ligatures; color: rgb(4, 51, 255);">do</span><span class="s3" style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-converted-space">&nbsp;</span>{</span></div><div style="margin: 0px; font-style: normal; font-variant-caps: normal; font-weight: normal; font-size: 11px; line-height: normal; font-family: Menlo; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span class="s3" style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-converted-space">&nbsp; &nbsp; &nbsp; &nbsp;<span class="Apple-converted-space">&nbsp;</span></span></span><span class="s2" style="font-variant-ligatures: no-common-ligatures; color: rgb(4, 51, 255);">try</span><span class="s3" style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-converted-space">&nbsp;</span></span><span class="s4" style="font-variant-ligatures: no-common-ligatures; color: rgb(52, 149, 175);">hello</span><span class="s3" style="font-variant-ligatures: no-common-ligatures;">()</span></div><div style="margin: 0px; font-style: normal; font-variant-caps: normal; font-weight: normal; font-size: 11px; line-height: normal; font-family: Menlo; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span class="s3" style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-converted-space">&nbsp; &nbsp;<span class="Apple-converted-space">&nbsp;</span></span>}<span class="Apple-converted-space">&nbsp;</span></span><span class="s2" style="font-variant-ligatures: no-common-ligatures; color: rgb(4, 51, 255);">catch</span><span class="s3" style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-converted-space">&nbsp;</span>Foo.</span><span class="s4" style="font-variant-ligatures: no-common-ligatures; color: rgb(52, 149, 175);">bar</span><span class="s3" style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-converted-space">&nbsp;</span>{</span></div><div style="margin: 0px; font-style: normal; font-variant-caps: normal; font-weight: normal; font-size: 11px; line-height: normal; font-family: Menlo; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span class="s3" style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-converted-space">&nbsp; &nbsp; &nbsp; &nbsp;<span class="Apple-converted-space">&nbsp;</span></span></span><span class="s6" style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 143, 0);">// ...</span></div><div style="margin: 0px; font-style: normal; font-variant-caps: normal; font-weight: normal; font-size: 11px; line-height: normal; font-family: Menlo; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span class="s3" style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-converted-space">&nbsp; &nbsp;<span class="Apple-converted-space">&nbsp;</span></span>}</span></div><div style="margin: 0px; font-style: normal; font-variant-caps: normal; font-weight: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 143, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span class="s5" style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-converted-space">&nbsp; &nbsp;<span class="Apple-converted-space">&nbsp;</span></span></span><span class="s3" style="font-variant-ligatures: no-common-ligatures;">// catch is exhaustive, no catch-all clause needed</span></div><div style="margin: 0px; font-style: normal; font-variant-caps: normal; font-weight: normal; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span class="s3" style="font-variant-ligatures: no-common-ligatures;"></span><br class=""></div><div style="margin: 0px; font-style: normal; font-variant-caps: normal; font-weight: normal; font-size: 11px; line-height: normal; font-family: Menlo; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span class="s3" style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-converted-space">&nbsp; &nbsp;<span class="Apple-converted-space">&nbsp;</span></span></span><span class="s2" style="font-variant-ligatures: no-common-ligatures; color: rgb(4, 51, 255);">try</span><span class="s3" style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-converted-space">&nbsp;</span></span><span class="s4" style="font-variant-ligatures: no-common-ligatures; color: rgb(52, 149, 175);">world</span><span class="s3" style="font-variant-ligatures: no-common-ligatures;">()</span></div><div style="margin: 0px; font-style: normal; font-variant-caps: normal; font-weight: normal; font-size: 11px; line-height: normal; font-family: Menlo; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span class="s3" style="font-variant-ligatures: no-common-ligatures;">}</span></div><div style="margin: 0px; font-style: normal; font-variant-caps: normal; font-weight: normal; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span class="s3" style="font-variant-ligatures: no-common-ligatures;"></span><br class=""></div><div style="margin: 0px; font-style: normal; font-variant-caps: normal; font-weight: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 143, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span class="s2" style="font-variant-ligatures: no-common-ligatures; color: rgb(4, 51, 255);">func</span><span class="s5" style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-converted-space">&nbsp;</span>universe() {<span class="Apple-converted-space">&nbsp;</span></span><span class="s3" style="font-variant-ligatures: no-common-ligatures;">// all errors are handled, no 'throws' declaration needed</span></div><div style="margin: 0px; font-style: normal; font-variant-caps: normal; font-weight: normal; font-size: 11px; line-height: normal; font-family: Menlo; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span class="s3" style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-converted-space">&nbsp; &nbsp;<span class="Apple-converted-space">&nbsp;</span></span></span><span class="s2" style="font-variant-ligatures: no-common-ligatures; color: rgb(4, 51, 255);">do</span><span class="s3" style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-converted-space">&nbsp;</span>{</span></div><div style="margin: 0px; font-style: normal; font-variant-caps: normal; font-weight: normal; font-size: 11px; line-height: normal; font-family: Menlo; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span class="s3" style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-converted-space">&nbsp; &nbsp; &nbsp; &nbsp;<span class="Apple-converted-space">&nbsp;</span></span></span><span class="s2" style="font-variant-ligatures: no-common-ligatures; color: rgb(4, 51, 255);">try</span><span class="s3" style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-converted-space">&nbsp;</span></span><span class="s4" style="font-variant-ligatures: no-common-ligatures; color: rgb(52, 149, 175);">galaxy</span><span class="s3" style="font-variant-ligatures: no-common-ligatures;">()</span></div><div style="margin: 0px; font-style: normal; font-variant-caps: normal; font-weight: normal; font-size: 11px; line-height: normal; font-family: Menlo; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span class="s3" style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-converted-space">&nbsp; &nbsp;<span class="Apple-converted-space">&nbsp;</span></span>}<span class="Apple-converted-space">&nbsp;</span></span><span class="s2" style="font-variant-ligatures: no-common-ligatures; color: rgb(4, 51, 255);">catch</span><span class="s3" style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-converted-space">&nbsp;</span>Foo.</span><span class="s4" style="font-variant-ligatures: no-common-ligatures; color: rgb(52, 149, 175);">baz</span><span class="s3" style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-converted-space">&nbsp;</span>{</span></div><div style="margin: 0px; font-style: normal; font-variant-caps: normal; font-weight: normal; font-size: 11px; line-height: normal; font-family: Menlo; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span class="s3" style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-converted-space">&nbsp; &nbsp; &nbsp; &nbsp;<span class="Apple-converted-space">&nbsp;</span></span></span><span class="s6" style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 143, 0);">// ..</span></div><div style="margin: 0px; font-style: normal; font-variant-caps: normal; font-weight: normal; font-size: 11px; line-height: normal; font-family: Menlo; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span class="s3" style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-converted-space">&nbsp; &nbsp;<span class="Apple-converted-space">&nbsp;</span></span>}</span></div><div style="margin: 0px; font-style: normal; font-variant-caps: normal; font-weight: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 143, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span class="s5" style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-converted-space">&nbsp; &nbsp;<span class="Apple-converted-space">&nbsp;</span></span></span><span class="s3" style="font-variant-ligatures: no-common-ligatures;">// catch is exhaustive, no catch-all clause needed</span></div><div style="margin: 0px; font-style: normal; font-variant-caps: normal; font-weight: normal; font-size: 11px; line-height: normal; font-family: Menlo; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span class="s3" style="font-variant-ligatures: no-common-ligatures;">}</span></div><div style="margin: 0px; font-style: normal; font-variant-caps: normal; font-weight: normal; font-size: 12px; line-height: normal; font-family: Helvetica; min-height: 14px; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class=""></div><div style="margin: 0px; font-style: normal; font-variant-caps: normal; font-weight: normal; font-size: 12px; line-height: normal; font-family: Helvetica; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">Now for clarity one could add the type information as per your proposal, but wouldn't be necessary as the compiler would infer it itself.</div><div style="margin: 0px; font-style: normal; font-variant-caps: normal; font-weight: normal; font-size: 12px; line-height: normal; font-family: Helvetica; min-height: 14px; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class=""></div><div style="margin: 0px; font-style: normal; font-variant-caps: normal; font-weight: normal; font-size: 12px; line-height: normal; font-family: Helvetica; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">Either way a +1 from me, as the current model forces one to catch-all errors, even the ones you did not expect to be thrown. Thus potentially hiding programming errors.</div></div></blockquote></div><br class=""><div class="">I would definitely give a strong -1 to any proposal that tried to have the compiler infer this, because it would break the ability for a future revision of galaxy() to add a new error that could potentially be thrown. If we’re going to add typed throws, they should only be added if deliberately specified by the developer.</div><div class=""><br class=""></div><div class="">Charles</div><div class=""><br class=""></div></body></html>