haskell-suite / haskell-src-exts

Manipulating Haskell source: abstract syntax, lexer, parser, and pretty-printer
Other
193 stars 94 forks source link

Parse error with record patterns and bang patterns #382

Open ndmitchell opened 6 years ago

ndmitchell commented 6 years ago

From https://github.com/ndmitchell/hlint/issues/386#issuecomment-330919204 by @Anabra:

{-# LANGUAGE BangPatterns #-}
module RecordPattern where

data Rec = Rec { num :: Int }

f :: Rec -> Int
f Rec { num = !num } = num

I get the error message:

ParseFailed (SrcLoc "<unknown>.hs" 7 15) "Parse error: !"

Presumably the bang pattern in a record wild card is causing issues.