summaryrefslogtreecommitdiff
path: root/compiler/typecheck/TcSplice.hs
diff options
context:
space:
mode:
authorIavor S. Diatchki <iavor.diatchki@gmail.com>2016-04-17 12:56:31 +0200
committerBen Gamari <ben@smart-cactus.org>2016-04-17 14:42:15 +0200
commit04b70cda4ed006c7e3df40e169550a00aba79524 (patch)
tree480cfd9e0e2bf8a937295311b113115458f62e71 /compiler/typecheck/TcSplice.hs
parent97f2b16483aae28dc8fd60b6d2e1e283618f2390 (diff)
downloadhaskell-04b70cda4ed006c7e3df40e169550a00aba79524.tar.gz
Add TemplateHaskell support for Overlapping pragmas
Reviewers: hvr, goldfire, austin, RyanGlScott, bgamari Reviewed By: RyanGlScott, bgamari Subscribers: RyanGlScott, thomie Differential Revision: https://phabricator.haskell.org/D2118
Diffstat (limited to 'compiler/typecheck/TcSplice.hs')
-rw-r--r--compiler/typecheck/TcSplice.hs8
1 files changed, 7 insertions, 1 deletions
diff --git a/compiler/typecheck/TcSplice.hs b/compiler/typecheck/TcSplice.hs
index 6183c59125..5483d0d432 100644
--- a/compiler/typecheck/TcSplice.hs
+++ b/compiler/typecheck/TcSplice.hs
@@ -1543,11 +1543,17 @@ reifyClassInstance is_poly_tvs i
; thtypes <- reifyTypes vis_types
; annot_thtypes <- zipWith3M annotThType is_poly_tvs vis_types thtypes
; let head_ty = mkThAppTs (TH.ConT (reifyName cls)) annot_thtypes
- ; return $ (TH.InstanceD cxt head_ty []) }
+ ; return $ (TH.InstanceD over cxt head_ty []) }
where
(_tvs, theta, cls, types) = tcSplitDFunTy (idType dfun)
cls_tc = classTyCon cls
dfun = instanceDFunId i
+ over = case overlapMode (is_flag i) of
+ NoOverlap _ -> Nothing
+ Overlappable _ -> Just TH.Overlappable
+ Overlapping _ -> Just TH.Overlapping
+ Overlaps _ -> Just TH.Overlaps
+ Incoherent _ -> Just TH.Incoherent
------------------------------
reifyFamilyInstances :: TyCon -> [FamInst] -> TcM [TH.Dec]