on master help sign in
Merge pull request #282 from RyanGlScott/master

Fix GHC HEAD build

commite4f663f77c37242440a3010022e3e79be291dbb2 authorBryan O'Sullivan <bos@serpentine.com> dateFri 18 Sep 2015, 09:58 (11 years ago) parent9abbdfadf144af
1 file changed+15−2
Data/Aeson/TH.hs+15−2
Data/Aeson/TH.hs+15−2
@@ -1035,10 +1035,18 @@ withType name f = do
10351035 DataD _ _ tvbs cons _ -> f name tvbs cons Nothing
10361036 NewtypeD _ _ tvbs con _ -> f name tvbs [con] Nothing
10371037 other -> error $ ns ++ "Unsupported type: " ++ show other
1038+#if MIN_VERSION_template_haskell(2,11,0)
1039+ DataConI _ _ parentName -> do
1040+#else
10381041 DataConI _ _ parentName _ -> do
1042+#endif
10391043 parentInfo <- reify parentName
10401044 case parentInfo of
1045+#if MIN_VERSION_template_haskell(2,11,0)
1046+ FamilyI (DataFamilyD _ tvbs _) decs ->
1047+#else
10411048 FamilyI (FamilyD DataFam _ tvbs _) decs ->
1049+#endif
10421050 let instDec = flip find decs $ \dec -> case dec of
10431051 DataInstD _ _ _ cons _ -> any ((name ==) . getConName) cons
10441052 NewtypeInstD _ _ _ con _ -> name == getConName con
@@ -1052,8 +1060,13 @@ withType name f = do
10521060 "Could not find data or newtype instance constructor."
10531061 _ -> error $ ns ++ "Data constructor " ++ show name ++
10541062 " is not from a data family instance constructor."
1055− FamilyI (FamilyD DataFam _ _ _) _ -> error $ ns ++
1056− "Cannot use a data family name. Use a data family instance constructor instead."
1063+#if MIN_VERSION_template_haskell(2,11,0)
1064+ FamilyI DataFamilyD{} _ ->
1065+#else
1066+ FamilyI (FamilyD DataFam _ _ _) _ ->
1067+#endif
1068+ error $ ns ++
1069+ "Cannot use a data family name. Use a data family instance constructor instead."
10571070 _ -> error $ ns ++ "I need the name of a plain data type constructor, "
10581071 ++ "or a data family instance constructor."
10591072 where