summaryrefslogtreecommitdiff
path: root/compiler/GHC/ThToHs.hs
diff options
context:
space:
mode:
authorMario Blažević <blamario@protonmail.com>2021-03-07 12:01:56 -0500
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-07-21 02:47:25 -0400
commit10124b16538091806953d732e24ca485a0664895 (patch)
tree179bba83b2daccb63cad2b8d6288209b614ec77d /compiler/GHC/ThToHs.hs
parent5b157eb2bea7fc4ad654c83258cf1ab6ad0f85f0 (diff)
downloadhaskell-10124b16538091806953d732e24ca485a0664895.tar.gz
template-haskell: Add support for default declarations
Fixes #19373
Diffstat (limited to 'compiler/GHC/ThToHs.hs')
-rw-r--r--compiler/GHC/ThToHs.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/GHC/ThToHs.hs b/compiler/GHC/ThToHs.hs
index e452841f7a..8d3df10185 100644
--- a/compiler/GHC/ThToHs.hs
+++ b/compiler/GHC/ThToHs.hs
@@ -226,6 +226,10 @@ cvtDec (TH.InfixD fx nm)
; returnJustLA (Hs.SigD noExtField (FixSig noAnn
(FixitySig noExtField [nm'] (cvtFixity fx)))) }
+cvtDec (TH.DefaultD tys)
+ = do { tys' <- traverse cvtType tys
+ ; returnJustLA (Hs.DefD noExtField $ DefaultDecl noAnn tys') }
+
cvtDec (PragmaD prag)
= cvtPragmaD prag