Skip to content

Missing parentheses and backticks

In several cases, GHC does not output parentheses or backticks in error messages. For example, compiling this contrived file

data A = (:&&) Int Int | A Int Int

x (+) ((&)@z) ((:&&) a b) (c :&& d) (e `A` f) (A g h) = y
  where infixl 3 `y`
        y _ = (&)
        {-# INLINE (&) #-}
        {-# SPECIALIZE (&) :: a #-}
        (&) = x

gives an error message containing:

x + (&@z) (:&& a b) (c :&& d) (e A f) (A g h)
  = y
  where
      infixl 3 y
      y _ = (&)
      {-# INLINE & #-}
      {-# SPECIALIZE & :: a #-}

Attached patch fixes this issue in several places.

Trac metadata
Trac field Value
Version 7.6.2
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