summaryrefslogtreecommitdiff
path: root/testsuite/tests
diff options
context:
space:
mode:
authorRyan Scott <ryan.gl.scott@gmail.com>2018-10-24 07:02:59 -0400
committerRyan Scott <ryan.gl.scott@gmail.com>2018-10-24 07:02:59 -0400
commitbb835c96c3d962c2e08d23f6fb900665c89953b4 (patch)
tree5178b9a108fe54f70c9db3ca3f14533043d2c0ff /testsuite/tests
parent79c641de60f1d6aa6f724d4fc49137ccbe3ab008 (diff)
downloadhaskell-bb835c96c3d962c2e08d23f6fb900665c89953b4.tar.gz
Keep top-level names in typed TH quotes alive
Summary: When renaming untyped TH quotes, some care is taken to ensure that uses of top-level names in quotes do not have their bindings discarded during desugaring. The same care was not applied to typed TH quotes, so this patch brings the two into sync. Test Plan: make test TEST=T15783 Reviewers: bgamari, mpickering Reviewed By: mpickering Subscribers: mpickering, rwbarton, carter GHC Trac Issues: #15783 Differential Revision: https://phabricator.haskell.org/D5248
Diffstat (limited to 'testsuite/tests')
-rw-r--r--testsuite/tests/th/T15783A.hs6
-rw-r--r--testsuite/tests/th/T15783B.hs6
-rw-r--r--testsuite/tests/th/all.T2
3 files changed, 14 insertions, 0 deletions
diff --git a/testsuite/tests/th/T15783A.hs b/testsuite/tests/th/T15783A.hs
new file mode 100644
index 0000000000..591a975530
--- /dev/null
+++ b/testsuite/tests/th/T15783A.hs
@@ -0,0 +1,6 @@
+{-# LANGUAGE TemplateHaskell #-}
+module T15783A where
+
+import T15783B
+
+main = $$f
diff --git a/testsuite/tests/th/T15783B.hs b/testsuite/tests/th/T15783B.hs
new file mode 100644
index 0000000000..818f57d52e
--- /dev/null
+++ b/testsuite/tests/th/T15783B.hs
@@ -0,0 +1,6 @@
+{-# LANGUAGE TemplateHaskell #-}
+module T15783B(f) where
+
+d = 0
+
+f = [|| d ||]
diff --git a/testsuite/tests/th/all.T b/testsuite/tests/th/all.T
index df114b57bf..d10523cf6c 100644
--- a/testsuite/tests/th/all.T
+++ b/testsuite/tests/th/all.T
@@ -439,3 +439,5 @@ test('TH_recursiveDo', normal, compile_and_run, ['-v0 -dsuppress-uniques'])
test('T15481', normal, compile, ['-v0 -ddump-splices -dsuppress-uniques'])
test('TH_recover_warns', normal, compile, ['-v0 -ddump-splices -dsuppress-uniques'])
test('T15738', normal, compile, ['-v0 -ddump-splices -dsuppress-uniques'])
+test('T15783', normal, multimod_compile,
+ ['T15783A', '-v0 ' + config.ghc_th_way_flags])