[GHC] #9392: "\n" is displayed weirdly in error messages

GHC ghc-devs at haskell.org
Fri Aug 1 17:35:44 UTC 2014


#9392: "\n" is displayed weirdly in error messages
-------------------------------------+-------------------------------------
       Reporter:  Artyom.Kazak       |                   Owner:
           Type:  bug                |                  Status:  new
       Priority:  low                |               Milestone:
      Component:  Compiler           |                 Version:  7.8.3
       Keywords:                     |        Operating System:
   Architecture:  Unknown/Multiple   |  Unknown/Multiple
     Difficulty:  Unknown            |         Type of failure:  Other
     Blocked By:                     |               Test Case:
Related Tickets:                     |                Blocking:
                                     |  Differential Revisions:
-------------------------------------+-------------------------------------
 Observe:

 {{{
 Prelude> "a\nb" + ()

 <interactive>:2:10:
     Couldn't match expected type ‘[Char]’ with actual type ‘()’
     In the second argument of ‘(+)’, namely ‘()’
     In the expression:
       "a\n\
       \b"
       + ()
 }}}

 Moreover, if “\n” is at the end of the string, it simply gets eaten:

 {{{
 Prelude> "a\n" + ()

 <interactive>:3:9:
     Couldn't match expected type ‘[Char]’ with actual type ‘()’
     In the second argument of ‘(+)’, namely ‘()’
     In the expression: "a" + ()
 }}}

 It happens in GHC as well as GHCi. Tested on 7.8.3.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9392>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list