Skip to content

Colorized error messages result in hard-to-read .dump-* files

To see this, compile this file:

module Main where

x :: String -> String
x s = print (reverse s + 1)

with ghc-stage2 -ddump-tc-trace -ddump-to-file. If you look at the resulting .dump-tc-trace file with a text editor like vim, you'll see at the bottom:

...
Tc7a
checkMain fail Main main
Adding error:
  ^[[;1mBug.hs:1:1: ^[[;1m^[[31merror:^[[;1m
      The IO action ‘main’ is not defined in module ‘Main’^[[0m

The error message is now much harder to discern that before the introduction of colorized error messages.

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