I didn&#39;t read the proposal to mean vanish; rather, just lazily displayed until some condition, but then permanently there once it shows up. It really is annoying to be constantly reminded you haven&#39;t used a variable when you&#39;ve literally just declared it. Once you&#39;ve left the scope once, it&#39;s fair to have that warning stay there whether or not you click back.<br><div class="gmail_quote"><div dir="ltr">On Wed, Jan 25, 2017 at 17:59 Karl Wagner via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br class="gmail_msg">
&gt; On 26 Jan 2017, at 00:46, Jonathan Hull via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="gmail_msg" target="_blank">swift-evolution@swift.org</a>&gt; wrote:<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; One of the biggest issues that I saw while teaching Swift to newbies (most had not programmed before) is confusion based on the early warnings/errors that swift/xcode gives you as they type.  What would happen is that they would type a variable, and it would say… “You haven’t used this variable” and so they would just click the fixit because they trust the compiler more than they trust themselves.  This would lead to a point where they were very confused because some of the code was code they had thought through, and some of it was changed by random fixits in ways they didn’t understand… and so it would lead to more errors/fixits until they had errors which couldn’t be fixed.<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; By the end of the semester they had learned to ignore the warnings until they were finished, but it took a couple of months to get there, and was a big deterrent to new users… (Also, learning to ignore warnings ignorer to use a system seems like an anti-pattern)<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; I have a good friend who is an expert perl programmer who tried Swift and eventually gave up because he couldn’t figure out which errors to ignore (and which might just disappear a minute later) and which he needed to pay attention to. He was overwhelmed by the sheer number, and they didn’t seem trustworthy to him (“Swift is full of lies!” he would say of the warnings… which is a mantra I find myself parroting when I get those appearing/disappearing errors).<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; To fix this, I propose adding a way to annotate warnings/errors to say how immediate they need to be:<br class="gmail_msg">
&gt; • Immediate - This error should always be shown<br class="gmail_msg">
&gt; • DifferentLine - This error should only be shown once the cursor is on a different line<br class="gmail_msg">
&gt; • DifferentScope - This error should only be shown once the cursor is in a different scope from this line<br class="gmail_msg">
&gt; • DifferentFunction - This error should only be shown once the cursor is in a different function<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; So the “You haven’t used this variable” warning would be marked .differentScope, meaning that it would only show up once you had clicked away from the scope. The reason for this is that while you are in the same scope, it is fairly likely that you are still going to use the variable… so the warning is premature. Once I have left the scope, it makes sense to warn me.<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; Similarly, the “You need a return value” error would be marked .differentFunction because you are likely to add one while typing the function. But a type mismatch with the return value would either be .immediate or .differentLine because you have made an error that isn’t likely to be fixed with more typing on other lines.<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; I think this will cut way down on the number of warnings/errors that need to be ignored, which should increase trust in the system overall.<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; To be clear, I am only proposing adding the annotation to Swift (probably with a default of .differentLine). The compiler would not repress the warning/error itself… just vend it with a way to retrieve the annotation.  IDE makers like Apple/Xcode would then be free to use that extra information in their UI if desired.<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; Thanks,<br class="gmail_msg">
&gt; Jon<br class="gmail_msg">
&gt; _______________________________________________<br class="gmail_msg">
&gt; swift-evolution mailing list<br class="gmail_msg">
&gt; <a href="mailto:swift-evolution@swift.org" class="gmail_msg" target="_blank">swift-evolution@swift.org</a><br class="gmail_msg">
&gt; <a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" class="gmail_msg" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class="gmail_msg">
<br class="gmail_msg">
Having warnings and errors vanish and then reappear as you click in/out of function seems far more confusing to me. Is there any other language/IDE that does things that way?<br class="gmail_msg">
<br class="gmail_msg">
- Karl<br class="gmail_msg">
_______________________________________________<br class="gmail_msg">
swift-evolution mailing list<br class="gmail_msg">
<a href="mailto:swift-evolution@swift.org" class="gmail_msg" target="_blank">swift-evolution@swift.org</a><br class="gmail_msg">
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" class="gmail_msg" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class="gmail_msg">
</blockquote></div>