Skip to content

NamedFieldPuns broken in where clauses

The attached file compiles fine under GHC 6.10. However, under 6.12, it produces the error

BadPun.hs:8:17:
    Conflicting definitions for `pun-right-hand-side'
    In the binding group for: pun-right-hand-side, pun-right-hand-side,
                              pun-right-hand-side

Note that this affects the named field puns only in the where clause of badPun; goodPun, which uses them in the LHS of a top-level definition, does not have this problem.

A possibly interesting additional note is that if you change Record{f1,f2,... to Record{f1=f1,f2,..., you'll find that you get this error message instead:

BadPun.hs:8:23:
    Conflicting definitions for `pun-right-hand-side'
    In the binding group for: f1, pun-right-hand-side,
                              pun-right-hand-side

Changing f2 to f2=f2 as well makes the error go away, presumably because there's now only one pun-right-hand-side defined.

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