<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2017-02-19 0:16 GMT+03:00 Martin Waitz <span dir="ltr">&lt;<a href="mailto:tali@admingilde.org" target="_blank">tali@admingilde.org</a>&gt;</span>:<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><div>Now some bike-shedding:</div><div>I’m not really happy with the `throws(Type)` syntax, as it is too close to function parameters.</div><div>Why exactly is `throws Type` ambiguous?</div><div>The proposal mentions `Type -&gt; Result` as potential thrown type, but functions cannot conform to `Error`.</div></div></div></blockquote><div><br></div><div>Well, it&#39;s expected to change with one of the follow-up proposals.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><div>Maybe we can instruct the parser to just allow simple type names between `throws` and the arrow `-&gt;`.</div></div></div></blockquote><div><br></div><div>The ambiguity here is not so &quot;to compiler&quot; as &quot;to human&quot;. We don&#39;t want people to spend extra time parsing the declaration.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div>If that is not possible, we should at least try to find some visual hints to separate Error type from function parameters.<br></div><div><br></div><div>E.g. we could use brackets (think of: we are specialising the `throws`):</div><div><br></div><div><span class="m_3522602531053247326Apple-tab-span" style="white-space:pre-wrap">        </span><span class="m_3522602531053247326pl-k" style="font-family:SFMono-Regular,Consolas,&#39;Liberation Mono&#39;,Menlo,Courier,monospace;font-size:13.600000381469727px;background-color:rgb(247,247,247);box-sizing:border-box;color:rgb(167,29,93)">func</span><span style="color:rgb(51,51,51);font-family:SFMono-Regular,Consolas,&#39;Liberation Mono&#39;,Menlo,Courier,monospace;font-size:13.600000381469727px;background-color:rgb(247,247,247)"> </span><span class="m_3522602531053247326pl-en" style="font-family:SFMono-Regular,Consolas,&#39;Liberation Mono&#39;,Menlo,Courier,monospace;font-size:13.600000381469727px;background-color:rgb(247,247,247);box-sizing:border-box;color:rgb(121,93,163)">foo</span><span style="color:rgb(51,51,51);font-family:SFMono-Regular,Consolas,&#39;Liberation Mono&#39;,Menlo,Courier,monospace;font-size:13.600000381469727px;background-color:rgb(247,247,247)">() </span><span class="m_3522602531053247326pl-k" style="font-family:SFMono-Regular,Consolas,&#39;Liberation Mono&#39;,Menlo,Courier,monospace;font-size:13.600000381469727px;background-color:rgb(247,247,247);box-sizing:border-box;color:rgb(167,29,93)">throws</span><span style="color:rgb(51,51,51);font-family:SFMono-Regular,Consolas,&#39;Liberation Mono&#39;,Menlo,Courier,monospace;font-size:13.600000381469727px;background-color:rgb(247,247,247)">&lt;MyError&gt; { </span><span class="m_3522602531053247326pl-k" style="font-family:SFMono-Regular,Consolas,&#39;Liberation Mono&#39;,Menlo,Courier,monospace;font-size:13.600000381469727px;background-color:rgb(247,247,247);box-sizing:border-box;color:rgb(167,29,93)">…</span><span style="color:rgb(51,51,51);font-family:SFMono-Regular,Consolas,&#39;Liberation Mono&#39;,Menlo,Courier,monospace;font-size:13.600000381469727px;background-color:rgb(247,247,247)"> }</span></div></div></blockquote><div><br></div><div> I personally prefer parentheses, because there is precedence of parametrized attributes. I wonder what others think on angle brackets option.</div></div></div></div>