id,summary,reporter,owner,description,type,status,priority,milestone,component,version,resolution,keywords,cc,os,architecture,failure,difficulty,testcase,blockedby,blocking,related
5509,quotes pretty-printer not working as comments specify,mgsloan1,,"I am currently working on a parser for GHC error messages, and would actually prefer that this remain unfixed, as this would make GHC error messages slightly harder to parse.

From compiler/utils/Outputable.lhs
{{{
-- quotes encloses something in single quotes...
-- but it omits them if the thing ends in a single quote
-- so that we don't get `foo''.  Instead we just have foo'.
quotes d = SDoc $ \sty -> 
           let pp_d = runSDoc d sty in
           case show pp_d of
             ('\'' : _) -> pp_d
             _other     -> Pretty.quotes pp_d
}}}

This implementation does not match the comment - the code is checking for a leading single-quote, not for a trailing one.  Therefore the following code does result in the {{{ `foo'' }}} that the comment specifically mentions:

{{{
foo' :: (Show a) => a -> IO ()
foo' = print
main = foo' print
}}}

{{{
Test.hs:3:8:
    No instance for (Show (a0 -> IO ()))
      arising from a use of `foo''
    Possible fix: add an instance declaration for (Show (a0 -> IO ()))
    In the expression: foo' print
    In an equation for `main': main = foo' print
}}}",bug,closed,normal,,Compiler,7.2.1,fixed,prettyprint,,Unknown/Multiple,Unknown/Multiple,Incorrect warning at compile-time,,,,,
