Thanks. I wonder if you could use a linter, if you can add some documentation to a function that the linter<span></span> can pick up then it&#39;s possible to do this now.<br><br>On Monday, 15 February 2016, Amir Michail &lt;<a href="mailto:a.michail@me.com">a.michail@me.com</a>&gt; wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><br><div><blockquote type="cite"><div>On Feb 13, 2016, at 10:39 PM, Andrew Bennett &lt;<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;cacoyi@gmail.com&#39;);" target="_blank">cacoyi@gmail.com</a>&gt; wrote:</div><br><div><div dir="ltr">Fantastic idea, it would be nice to be able to do this in such a way that it didn&#39;t bloat out a function&#39;s definition. This is similar to the code-by-contract discussions that have happened in the past. This may be breaking into macro territory though. Perhaps it could be expressed like this:</div></div></blockquote><div><br></div><div>BTW, you might want to check out this related work as well:</div><div><br></div><div><a href="http://types.cs.washington.edu/checker-framework/" target="_blank">http://types.cs.washington.edu/checker-framework/</a></div><div><a href="http://types.cs.washington.edu/checker-framework/tutorial/webpages/user-input-eclipse.html" target="_blank">http://types.cs.washington.edu/checker-framework/tutorial/webpages/user-input-eclipse.html</a></div><div><a href="http://types.cs.washington.edu/checker-framework/current/checker-framework-manual.html#writing-a-checker" target="_blank">http://types.cs.washington.edu/checker-framework/current/checker-framework-manual.html#writing-a-checker</a></div><br><blockquote type="cite"><div><div dir="ltr"><div><br></div><div><font face="monospace, monospace">@callVerification func verifyNoLiterals(inNode node: ASTNode) -&gt; [CallVerificationError] {</font></div><div><font face="monospace, monospace">    ...</font></div><div><font face="monospace, monospace">}</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">@verifyCall(noLiterals)</font></div><div><span style="font-size:13px"><font face="monospace, monospace">func precondition(success: Bool) {</font></span></div><div><span style="font-size:13px"><font face="monospace, monospace">    ...</font></span></div><div><span style="font-size:13px"><font face="monospace, monospace">}</font></span><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Feb 13, 2016 at 8:15 AM, Amir Michail via swift-evolution <span dir="ltr">&lt;<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;swift-evolution@swift.org&#39;);" target="_blank">swift-evolution@swift.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">For example, the Swift standard library might want to ensure that you use &quot;preconditionFailure()&quot; instead of &quot;precondition(false)&quot; since the former doesn’t get in the way of constant/variable initialization static analysis.<div><br></div><div>So maybe allow functions to have a warning clause with an abstract syntax tree parameter allowing the function to examine its usage context in the source code and issue warnings correspondingly that appear during the compile.</div><div><br></div><div>Here’s some related work: <a href="https://msdn.microsoft.com/en-us/magazine/dn879356.aspx" target="_blank">https://msdn.microsoft.com/en-us/magazine/dn879356.aspx</a></div><div><br></div></div><br>_______________________________________________<br>
swift-evolution mailing list<br>
<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;swift-evolution@swift.org&#39;);" target="_blank">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
<br></blockquote></div><br></div>
</div></blockquote></div><br></div></blockquote>