<div class="gmail_quote">On Mon, Jun 4, 2012 at 10:42 AM, Nico Weber <span dir="ltr"><<a href="mailto:thakis@chromium.org" target="_blank">thakis@chromium.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<div><br></div><div>several threads on this list discussed that fixits on errors and warnings have to be very likely correct. "did you mean" fixits on the other hand should go on a separate note instead. The attached patch adds this to the internals manual.</div>
</blockquote><div><br></div><div>This is great, but we need to go further really.</div><div><br></div><div>There is another reason why not to attach a fixit hint to an error or warning: doing so is *required* to recover the parse as-if the fixit hint had been applied.</div>
<div><br></div><div>For errors, this is reasonably easy to achieve. We just insist that if we can emit a fixit hint, we recover in the parser as-if.</div><div><br></div><div>For warnings, this is almost impossible. It can only be done when the suggested fixit has zero semantic impact on the AST produced. There are only a few cases, for example changing 'struct' to 'class' in a *forward* declaration. This makes fixit hints only rarely get attached to warnings.</div>
</div>