Skip to content

Bad error message when unidirectional pattern synonym used in bidirectional pattern synonym

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@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
Trac metadata
Trac field Value
Version 8.0.1
Type Bug
TypeOfFailure OtherFailure
Priority low
Resolution Unresolved
Component Compiler (Type checker)
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