Skip to content

SrcLoc of "Recursive pattern synonym definition" error is off

Compiling this file

{-# LANGUAGE PatternSynonyms #-}

pattern P x = P x

Leads to the following error:

Main.hs:1:1: error:
    Recursive pattern synonym definition with following bindings:
      P (defined at Main.hs:3:1-17)
  |
1 | {-# LANGUAGE PatternSynonyms #-}
  | ^

The SrcLoc of that error seems off; I'd expected it to print line 3 instead.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information