Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#13969 closed bug (duplicate)

Record pattern synonym incorrectly claims it's recursive, given unbound variable

Reported by: Iceland_jack Owned by:
Priority: normal Milestone:
Component: Compiler Version: 8.0.1
Keywords: PatternSynonyms Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Incorrect error/warning at compile-time Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


I only have access to an older version (GHC 8.0.1), this may have been fixed.

If I define

{-# language PatternSynonyms #-}

pattern R{aaa} = uuu

it complains about a recursive pattern synonym

$ ghci-8.0.1 -ignore-dot-ghci /tmp/tmp.hs
GHCi, version 8.0.1:  :? for help
[1 of 1] Compiling Main             ( /tmp/tmp.hs, interpreted )

/tmp/tmp.hs:1:1: error:
    Recursive pattern synonym definition with following bindings:
      R (defined at /tmp/tmp.hs:3:1-22)
Failed, modules loaded: none.

Change History (2)

comment:1 Changed 2 years ago by RyanGlScott

Resolution: duplicate
Status: newclosed

It's fixed in GHC HEAD (probably by #13470):

$ /opt/ghc/head/bin/ghc Bug.hs
[1 of 1] Compiling Main             ( Bug.hs, Bug.o )

Bug.hs:3:11: error: Not in scope: ‘aaa’
3 | pattern R{aaa} = uuu
  |           ^^^

comment:2 Changed 2 years ago by Iceland_jack

Thanks for verifying!

Note: See TracTickets for help on using tickets.