Opened 11 days ago

Closed 11 days ago

Last modified 11 days 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:

Description

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: http://www.haskell.org/ghc/  :? 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.
Prelude>

Change History (2)

comment:1 Changed 11 days 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 11 days ago by Iceland_jack

Thanks for verifying!

Note: See TracTickets for help on using tickets.