Opened 3 years ago

Closed 3 years ago

#5318 closed bug (fixed)

badly formatted error message

Reported by: igloo Owned by:
Priority: normal Milestone:
Component: Compiler Version: 7.1
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Difficulty:
Test Case: Blocked By:
Blocking: Related Tickets:

Description

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.

Change History (3)

comment:1 Changed 3 years ago by simonpj@…

commit b046a48c5eae737cd37d2dd2fb6bd65cd036a1de
Author: Simon Peyton Jones <simonpj@microsoft.com>
Date:   Fri Jul 15 14:44:44 2011 +0100

    Improve pretty printing of infix HsOpApp (fixes #5318)

comment:2 Changed 3 years ago by simonpj

  • Status changed from new to merge

Fixed by the above commit. Thanks for pointing this out.

comment:3 Changed 3 years ago by igloo

  • Resolution set to fixed
  • Status changed from merge to closed
Note: See TracTickets for help on using tickets.