[GHC] #9681: Printing of "\n" in error messages is broken

#9681: Printing of "\n" in error messages is broken -------------------------------------+------------------------------------- Reporter: oerjan | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.3 Keywords: | Operating System: Architecture: Unknown/Multiple | Unknown/Multiple Difficulty: Unknown | Type of failure: Blocked By: | None/Unknown Related Tickets: | Test Case: 1+"\n" | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- The code excerpts in error messages from GHC 7.8.3 are misformatted when the original code contains the string "\n" - the \n escape is simply lost. Example with GHCi: {{{ Prelude> 1+"\n" <interactive>:2:2: No instance for (Num [Char]) arising from a use of `+' In the expression: 1 + "" In an equation for `it': it = 1 + "" }}} The printing of the string "\n " is also strangely formatted, although technically equivalent: {{{ Prelude> 1+"\n " <interactive>:3:2: No instance for (Num [Char]) arising from a use of `+' In the expression: 1 + "\n\ \ " In an equation for `it': it = 1 + "\n\ \ " }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9681 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9681: Printing of "\n" in error messages is broken -------------------------------------+------------------------------------- Reporter: oerjan | Owner: Type: bug | Status: new Priority: high | Milestone: 7.10.1 Component: Compiler | Version: 7.8.3 Resolution: | Keywords: Operating System: | Architecture: Unknown/Multiple Unknown/Multiple | Difficulty: Unknown Type of failure: | Blocked By: None/Unknown | Related Tickets: Test Case: 1+"\n" | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Changes (by simonpj): * priority: normal => high * milestone: => 7.10.1 Comment: That's very odd, but can't be hard for someone to find. A nice contained bug-fix, if someone feels like looking. I the offending function is probably `Outputable.pprHsString`. Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9681#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9681: Printing of "\n" in error messages is broken -------------------------------------+------------------------------------- Reporter: oerjan | Owner: Type: bug | Status: new Priority: high | Milestone: 7.10.1 Component: Compiler | Version: 7.8.3 Resolution: | Keywords: Operating System: | Architecture: Unknown/Multiple Unknown/Multiple | Difficulty: Unknown Type of failure: | Blocked By: None/Unknown | Related Tickets: Test Case: 1+"\n" | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by mlen): According to #4436, the formatting is intended behavior for multiline strings. Maybe that behavior should be only enabled with TH or only non-blank lines. I started to work on the case when single newline character is truncated in the output. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9681#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9681: Printing of "\n" in error messages is broken -------------------------------------+------------------------------------- Reporter: oerjan | Owner: Type: bug | Status: infoneeded Priority: high | Milestone: 7.10.1 Component: Compiler | Version: 7.8.3 Resolution: | Keywords: Operating System: | Architecture: Unknown/Multiple Unknown/Multiple | Difficulty: Unknown Type of failure: | Blocked By: None/Unknown | Related Tickets: Test Case: 1+"\n" | Blocking: | Differential Revisions: Phab:D405 | -------------------------------------+------------------------------------- Changes (by mlen): * cc: simonpj (added) * status: new => infoneeded * differential: => Phab:D405 Comment: The patch is available @ Phab:D405 It covers only the case of missing newline, since I didn't know what to do about the formatting issue. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9681#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9681: Printing of "\n" in error messages is broken
-------------------------------------+-------------------------------------
Reporter: oerjan | Owner:
Type: bug | Status: infoneeded
Priority: high | Milestone: 7.10.1
Component: Compiler | Version: 7.8.3
Resolution: | Keywords:
Operating System: | Architecture: Unknown/Multiple
Unknown/Multiple | Difficulty: Unknown
Type of failure: | Blocked By:
None/Unknown | Related Tickets:
Test Case: 1+"\n" |
Blocking: |
Differential Revisions: Phab:D405 |
-------------------------------------+-------------------------------------
Comment (by Austin Seipp

#9681: Printing of "\n" in error messages is broken -------------------------------------+------------------------------------- Reporter: oerjan | Owner: Type: bug | Status: closed Priority: high | Milestone: 7.10.1 Component: Compiler | Version: 7.8.3 Resolution: fixed | Keywords: Operating System: | Architecture: Unknown/Multiple Unknown/Multiple | Difficulty: Unknown Type of failure: | Blocked By: None/Unknown | Related Tickets: Test Case: 1+"\n" | Blocking: | Differential Revisions: Phab:D405 | -------------------------------------+------------------------------------- Changes (by thoughtpolice): * status: infoneeded => closed * resolution: => fixed Comment: Merged, thanks! I think any fixes to formatting long strings can happen later. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9681#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC