<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">This looks pretty good to me. What's "in progress" about it?<div class=""><br class=""></div><div class="">I would want to see a comment on the declaration for HsArgPar with an example, and a test case.</div><div class=""><br class=""></div><div class="">Thanks!</div><div class="">Richard<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Jun 7, 2018, at 6:38 AM, Zubin Duggal <<a href="mailto:zubin.duggal@gmail.com" class="">zubin.duggal@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="">Hello all,</div><div class=""><br class=""></div><div class="">The typechecker doesn't preserve parenthesis that occur at the head of applications.<br class=""><br class="">This results in some weird SrcSpans in the TypecheckedSource<br class=""><br class="">For example, given code<br class=""><br class="">foo a b c = (bar a) b c<br class=""><br class="">The typechecker will emit an HsApp with head spanning over `bar a) b` and tail spanning over `c`.<br class="">Notice that the opening parenthesis is not included.<br class=""><br class="">On the other hand, the renamer will generate the expected SrcSpans that always include both parenthesis, or neither. This becomes an issue when you want to associate RenamedSource with its corresponding TypecheckedSource, as the SrcSpans no longer match and overlap partially.<br class=""><br class="">This occurs due to this line in TcExpr.hs<br class=""><br class="">tcApp m_herald (L _ (HsPar _ fun)) args res_ty<br class="">  = tcApp m_herald fun args res_ty<br class=""><br class="">I have a work in progress fix here: <a href="https://github.com/wz1000/ghc/commit/3b6db5a35dc8677a7187e349a85ffd51f452452a" class="">https://github.com/wz1000/ghc/commit/3b6db5a35dc8677a7187e349a85ffd51f452452a</a></div><div class=""><br class=""></div><div class="">I have also created a ticket on trac: <a href="https://ghc.haskell.org/trac/ghc/ticket/15242#ticket" class="">https://ghc.haskell.org/trac/ghc/ticket/15242#ticket</a><br class=""></div></div>
_______________________________________________<br class="">ghc-devs mailing list<br class=""><a href="mailto:ghc-devs@haskell.org" class="">ghc-devs@haskell.org</a><br class="">http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs<br class=""></div></blockquote></div><br class=""></div></body></html>