Skip to content

Infix declarations for record fields with DuplicateRecordFields are broken

The following program compiles fine

module Good where
newtype A = A { foo :: Int }
infixl 5 `foo`

but this one doesn't

{-# LANGUAGE DuplicateRecordFields #-}
module Bad where
newtype A = A { foo :: Int }
infixl 5 `foo`

giving an error

The fixity signature for ‘foo’ lacks an accompanying binding
 (The fixity signature must be given where ‘foo’ is declared)
Trac metadata
Trac field Value
Version 7.11
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