Don't ignore addTopDecls in module finalizers.
authorFacundo Domínguez <facundo.dominguez@tweag.io>
Thu, 1 Sep 2016 14:00:08 +0000 (11:00 -0300)
committerFacundo Domínguez <facundo.dominguez@tweag.io>
Mon, 5 Sep 2016 13:34:02 +0000 (10:34 -0300)
commit71dd6e4429833238bcdaf96da8e2e41a62dacbf4
tree4145128b819f52b9fd8bf57d9d5d486eeba88110
parentcdbb9da7a1330366678c4e29d11a48e591c1ac1e
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
compiler/rename/RnSplice.hs
compiler/typecheck/TcRnDriver.hs
compiler/typecheck/TcSplice.hs
testsuite/tests/th/TH_finalizer2.hs [new file with mode: 0644]
testsuite/tests/th/TH_finalizer2.stdout [new file with mode: 0644]
testsuite/tests/th/TH_finalizer2M.hs [new file with mode: 0644]
testsuite/tests/th/all.T