From 22318105ae3187c1f998ebd5fe51c3b5f7baba8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gr=C3=B6ber?= Date: Wed, 18 May 2016 17:58:34 +0200 Subject: [PATCH] some GHC 8.0.1 fixes --- Language/Haskell/GhcMod/FillSig.hs | 2 +- Language/Haskell/GhcMod/SrcUtils.hs | 8 +++++++- NotCPP/Declarations.hs | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Language/Haskell/GhcMod/FillSig.hs b/Language/Haskell/GhcMod/FillSig.hs index bd84504..3f7ae4c 100644 --- a/Language/Haskell/GhcMod/FillSig.hs +++ b/Language/Haskell/GhcMod/FillSig.hs @@ -134,7 +134,7 @@ getSignature modSum lineNo colNo = do Just (clsName,loc) -> obtainClassInfo minfo clsName loc _ -> return Nothing #if __GLASGOW_HASKELL__ >= 800 - [L loc (G.TyClD (G.FamDecl (G.FamilyDecl info (L _ name) (G.HsQTvs _ vars) _ _)))] -> do + [L loc (G.TyClD (G.FamDecl (G.FamilyDecl info (L _ name) (G.HsQTvs _ vars _) _ _)))] -> do #elif __GLASGOW_HASKELL__ >= 708 [L loc (G.TyClD (G.FamDecl (G.FamilyDecl info (L _ name) (G.HsQTvs _ vars) _)))] -> do #elif __GLASGOW_HASKELL__ >= 706 diff --git a/Language/Haskell/GhcMod/SrcUtils.hs b/Language/Haskell/GhcMod/SrcUtils.hs index 961bfae..3991b3d 100644 --- a/Language/Haskell/GhcMod/SrcUtils.hs +++ b/Language/Haskell/GhcMod/SrcUtils.hs @@ -1,4 +1,5 @@ -{-# LANGUAGE TupleSections, FlexibleInstances, Rank2Types, ImpredicativeTypes #-} +-- TODO: remove CPP once Gap(ed) +{-# LANGUAGE CPP, TupleSections, FlexibleInstances, Rank2Types, ImpredicativeTypes #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Language.Haskell.GhcMod.SrcUtils where @@ -106,7 +107,12 @@ collectSpansTypes withConstraints tcs lc = -- list of constraints preds = concatMap fst ctys -- Type variable substitutions +#if __GLASGOW_HASKELL__ >= 800 + -- TODO: move to Gap + subs = G.mkTvSubstPrs $ concatMap snd ctys +#else subs = G.mkTopTvSubst $ concatMap snd ctys +#endif -- Constrained type ty = G.substTy subs $ G.mkFunTys preds genTyp in [(spn, ty)] diff --git a/NotCPP/Declarations.hs b/NotCPP/Declarations.hs index b57feae..9567689 100644 --- a/NotCPP/Declarations.hs +++ b/NotCPP/Declarations.hs @@ -133,7 +133,7 @@ boundNames decl = #endif map ((,) TcClsName) (conNames ctor) - InstanceD _ _ty _ -> + InstanceD {} -> -- _ _ty _ error "notcpp: Instance declarations are not supported yet" ForeignD _ -> error "notcpp: Foreign declarations are not supported yet"