[GHC] #12535: Bad error message when unidirectional pattern synonym used in bidirectional pattern synonym

GHC ghc-devs at haskell.org
Thu Aug 25 07:57:05 UTC 2016


#12535: Bad error message when unidirectional pattern synonym used in bidirectional
pattern synonym
-------------------------------------+-------------------------------------
           Reporter:  ezyang         |             Owner:
               Type:  bug            |            Status:  new
           Priority:  low            |         Milestone:
          Component:  Compiler       |           Version:  8.0.1
  (Type checker)                     |
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 If I write:

 {{{
 {-# LANGUAGE PatternSynonyms #-}
 module I where

 pattern P2 x y <- (x, y)
 pattern P1 x y = P2 x y
 }}}

 I get the error:

 {{{
 ezyang at sabre:~$ ghc-8.0 -c I.hs

 I.hs:5:18: error:
     • non-bidirectional pattern synonym ‘P2’ used in an expression
     • In the expression: P2 x y
       In an equation for ‘$bP1’: $bP1 x y = P2 x y
 }}}

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12535>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list