Skip to content

badly formatted error message

When compiling this module:

module Foo where

pprx
    =  text "aaaaaaaaaa"
    $$ text "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"
    $$ text ""
    $$ text "ccccccccccccccccccccccccccccccccccccc"
    $$ text ""
    $$ text "ddddddddddddddddddddddddddddddddddddddddd"
    $$ ppr (raCodeCoalesced s)
    $$ text ""
    $$ text ""

s = undefined
($$) = undefined
text = undefined
raCodeCoalesced = undefined

class Outputable a where
    ppr :: a -> ()

GHC gives a poorly formatted error message:

$ ghc -c w.hs

w.hs:11:8:
    Ambiguous type variable `a0' in the constraint:
      (Outputable a0) arising from a use of `ppr'
    Probable fix: add a type signature that fixes these type variable(s)
    In the second argument of `($$)', namely `ppr (raCodeCoalesced s)'
    In the first argument of `($$)', namely
      `text "aaaaaaaaaa" $$ text "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"
   $$
     text ""
 $$
   text "ccccccccccccccccccccccccccccccccccccc"
$$
 text ""
$$
text "ddddddddddddddddddddddddddddddddddddddddd"
$$
ppr (raCodeCoalesced s)'
    In the first argument of `($$)', namely
      `text "aaaaaaaaaa" $$ text "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"
   $$
     text ""
 $$
   text "ccccccccccccccccccccccccccccccccccccc"
$$
 text ""
$$
text "ddddddddddddddddddddddddddddddddddddddddd"
$$
ppr (raCodeCoalesced s)
$$
text ""'

I would expect the entire quoted code to be indented at least 7 spaces.

Trac metadata
Trac field Value
Version 7.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information