summaryrefslogtreecommitdiff
path: root/compiler/rename
diff options
context:
space:
mode:
authorFacundo Domínguez <facundo.dominguez@tweag.io>2016-09-01 11:00:08 -0300
committerFacundo Domínguez <facundo.dominguez@tweag.io>2016-09-05 10:34:02 -0300
commit71dd6e4429833238bcdaf96da8e2e41a62dacbf4 (patch)
tree4145128b819f52b9fd8bf57d9d5d486eeba88110 /compiler/rename
parentcdbb9da7a1330366678c4e29d11a48e591c1ac1e (diff)
downloadhaskell-71dd6e4429833238bcdaf96da8e2e41a62dacbf4.tar.gz
Don't ignore addTopDecls in module finalizers.
Summary: Module finalizer could call addTopDecls, however, the declarations added in this fashion were ignored. This patch makes sure to rename, type check and incorporate this declarations. Because a declaration may include a splice which calls addModFinalizer, the list of finalizers is repeteadly checked after adding declarations until no more finalizers remain. Test Plan: ./validate Reviewers: bgamari, goldfire, simonpj, austin Reviewed By: bgamari, simonpj Subscribers: simonmar, mboes, thomie Differential Revision: https://phabricator.haskell.org/D2505 GHC Trac Issues: #12559
Diffstat (limited to 'compiler/rename')
-rw-r--r--compiler/rename/RnSplice.hs1
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/rename/RnSplice.hs b/compiler/rename/RnSplice.hs
index 1b99376a51..4b2e561d29 100644
--- a/compiler/rename/RnSplice.hs
+++ b/compiler/rename/RnSplice.hs
@@ -654,6 +654,7 @@ rnTopSpliceDecls splice
--
-- See Note [Delaying modFinalizers in untyped splices].
add_mod_finalizers_now :: [ForeignRef (TH.Q ())] -> TcRn ()
+ add_mod_finalizers_now [] = return ()
add_mod_finalizers_now mod_finalizers = do
th_modfinalizers_var <- fmap tcg_th_modfinalizers getGblEnv
updTcRef th_modfinalizers_var $ \fins ->