Skip to content

Instantly share code, notes, and snippets.

@qrilka
Created December 25, 2012 13:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save qrilka/4373331 to your computer and use it in GitHub Desktop.
Save qrilka/4373331 to your computer and use it in GitHub Desktop.
Example from aeson docs - fails in GHC 7.4.1
{-# LANGUAGE TemplateHaskell #-}
module Test where
import Data.Aeson
import Data.Aeson.TH
data D a = Nullary
| Unary Int
| Product String Char a
| Record { testOne :: Double
, testTwo :: Bool
, testThree :: D a
} deriving Eq
d :: D Int
d = Record { testOne = 3.14159
, testTwo = True
, testThree = Product "test" 'A' 123
}
$(deriveJSON (drop 4) ''D)
main = print $ fromJSON (toJSON d) == Success d
@qrilka
Copy link
Author

qrilka commented Dec 25, 2012

GHC 7.4.1 output:

Test.hs:20:3:ghc: panic! (the 'impossible' happened)
  (GHC version 7.4.1 for x86_64-unknown-linux):
    Can't happen: pprExp (CompExp [])

Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment