Add fix for GHC 7.4

This commit is contained in:
Alejandro Serrano 2014-07-27 14:11:54 +02:00
parent 32367fba4c
commit e3853a49f1

View File

@ -112,9 +112,15 @@ getSignature modSum lineNo colNo = do
G.TypeFamily -> Open G.TypeFamily -> Open
G.DataFamily -> Data G.DataFamily -> Data
#endif #endif
#if __GLASGOW_HASKELL__ >= 706
getTyFamVarName = \x -> case x of getTyFamVarName = \x -> case x of
L _ (G.UserTyVar n) -> n L _ (G.UserTyVar n) -> n
L _ (G.KindedTyVar n _) -> n L _ (G.KindedTyVar n _) -> n
#else
getTyFamVarName = \x -> case x of -- In GHC 7.4, HsTyVarBndr's have an extra arg
L _ (G.UserTyVar n _) -> n
L _ (G.KindedTyVar n _ _) -> n
#endif
in return $ Just (TyFamDecl loc name flavour $ map getTyFamVarName vars) in return $ Just (TyFamDecl loc name flavour $ map getTyFamVarName vars)
_ -> return Nothing _ -> return Nothing
where obtainClassInfo :: GhcMonad m => G.ModuleInfo -> G.Name -> SrcSpan -> m (Maybe SigInfo) where obtainClassInfo :: GhcMonad m => G.ModuleInfo -> G.Name -> SrcSpan -> m (Maybe SigInfo)