[commit: ghc] wip/T9858-typeable-ben: Fix data family constructor (49a2c9d)

git at git.haskell.org git at git.haskell.org
Fri Aug 28 09:47:12 UTC 2015


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/T9858-typeable-ben
Link       : http://ghc.haskell.org/trac/ghc/changeset/49a2c9d753fd79e709e69fdbffd803d1f6a8ba84/ghc

>---------------------------------------------------------------

commit 49a2c9d753fd79e709e69fdbffd803d1f6a8ba84
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Fri Aug 28 10:47:40 2015 +0100

    Fix data family constructor


>---------------------------------------------------------------

49a2c9d753fd79e709e69fdbffd803d1f6a8ba84
 compiler/typecheck/TcSplice.hs | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/compiler/typecheck/TcSplice.hs b/compiler/typecheck/TcSplice.hs
index 7c9882b..961da3c 100644
--- a/compiler/typecheck/TcSplice.hs
+++ b/compiler/typecheck/TcSplice.hs
@@ -1336,10 +1336,9 @@ reifyFunDep (xs, ys) = TH.FunDep (map reifyName xs) (map reifyName ys)
 
 reifyFamFlavour :: TyCon -> TcM (Either TH.FamFlavour [TH.TySynEqn])
 reifyFamFlavour tc
-  | isOpenTypeFamilyTyCon tc = return $ Left TH.TypeFam
-  | isDataFamilyTyCon     tc = return $ Left TH.DataFam
   | Just flav <- famTyConFlav_maybe tc = case flav of
       OpenSynFamilyTyCon           -> return $ Left TH.TypeFam
+      DataFamilyTyCon {}           -> return $ Left TH.TypeFam
       AbstractClosedSynFamilyTyCon -> return $ Right []
       BuiltInSynFamTyCon _         -> return $ Right []
       ClosedSynFamilyTyCon Nothing -> return $ Right []
@@ -1347,7 +1346,7 @@ reifyFamFlavour tc
         -> do { eqns <- brListMapM reifyAxBranch $ coAxiomBranches ax
               ; return $ Right eqns }
   | otherwise
-  = panic "TcSplice.reifyFamFlavour: not a type family"
+  = pprPanic "TcSplice.reifyFamFlavour: not a type family" (ppr tc)
 
 reifyTyVars :: [TyVar]
             -> TcM [TH.TyVarBndr]



More information about the ghc-commits mailing list