GHC 8.4.1 regression: derived Read instances with field names containing # no longer parse
(Originally noticed here.)
Consider the following program:
{-# LANGUAGE MagicHash #-}
module Bug where
data T a = MkT { runT# :: a }
deriving (Read, Show)
t1, t2 :: T Int
t1 = MkT 1
t2 = read $ show t1
main :: IO ()
main = print t2
In GHC 8.2.1, this runs without issue:
$ /opt/ghc/8.2.2/bin/runghc Bug.hs
MkT {runT# = 1}
In GHC 8.4.1, however, this produces a runtime error:
$ ~/Software/ghc-8.4.1/bin/runghc Bug.hs
Bug.hs: Prelude.read: no parse
Edited by Ryan Scott