<div dir="ltr"><div>So it appears the `Missing` item is correct, but it has been given the wrong SrcSpan. Originally it was a `noLoc`.<br><br></div>I think I will just advance the column by one, then it is actually correct, and the annotation lookup will only succeed for the first one, so it will all just work.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jun 17, 2015 at 5:14 PM, GHC <span dir="ltr"><<a href="mailto:ghc-devs@haskell.org" target="_blank">ghc-devs@haskell.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">#10537: Parser: commas_tup_tail returns spurious "Missing" value<br>
-------------------------------------+-------------------------------------<br>
Reporter: alanz | Owner: alanz<br>
Type: bug | Status: new<br>
Priority: normal | Milestone: 7.10.2<br>
Component: Compiler | Version: 7.10.1<br>
</span><span class=""> (Parser) | Keywords:<br>
Resolution: | Architecture:<br>
Operating System: Unknown/Multiple | Unknown/Multiple<br>
Type of failure: None/Unknown | Test Case:<br>
Blocked By: | Blocking:<br>
Related Tickets: | Differential Revisions:<br>
-------------------------------------+-------------------------------------<br>
<br>
</span>Comment (by mpickering):<br>
<br>
I think you're right Simon. There is something wrong with the annotations<br>
though, firstly both the Missing elements have the same SrcSpan `L<br>
tests/examples/Tuple.hs:3:24`.<br>
<br>
{{{<br>
((tests/examples/Tuple.hs:3:8, AnnComma),<br>
[tests/examples/Tuple.hs:3:9]),<br>
((tests/examples/Tuple.hs:3:11-17, AnnComma),<br>
[tests/examples/Tuple.hs:3:18]),<br>
((tests/examples/Tuple.hs:3:20-22, AnnComma),<br>
[tests/examples/Tuple.hs:3:23]),<br>
((tests/examples/Tuple.hs:3:24, AnnComma),<br>
[tests/examples/Tuple.hs:3:24]),<br>
}}}<br>
<br>
Here are the relevant annotations. Notice how the first three commas are<br>
associated with the preceding item (much like they are for lists) but the<br>
last one is associated directly with the `Missing`. As both `Missing`s<br>
have the same SrcSpan then this is causing duplicated output in `ghc-<br>
exactprint`.<br>
<br>
--<br>
Ticket URL: <<a href="http://ghc.haskell.org/trac/ghc/ticket/10537#comment:2" rel="noreferrer" target="_blank">http://ghc.haskell.org/trac/ghc/ticket/10537#comment:2</a>><br>
<div class="HOEnZb"><div class="h5">GHC <<a href="http://www.haskell.org/ghc/" rel="noreferrer" target="_blank">http://www.haskell.org/ghc/</a>><br>
The Glasgow Haskell Compiler<br>
</div></div></blockquote></div><br></div>