summaryrefslogtreecommitdiff
path: root/testsuite/tests/th/T9693_main.hs
diff options
context:
space:
mode:
authorMichael Sloan <mgsloan@gmail.com>2018-07-06 11:00:10 -0400
committerBen Gamari <ben@smart-cactus.org>2018-07-06 14:08:37 -0400
commitfbe162f58caa31df445d9edbf0b0919810687011 (patch)
tree50b6503e48a9c82b8f499a9dc45144ace3d661a6 /testsuite/tests/th/T9693_main.hs
parentf59332f92b30306675da22150de092eeebbf55f3 (diff)
downloadhaskell-fbe162f58caa31df445d9edbf0b0919810687011.tar.gz
Add a broken test for lingering state from TH unique names #9693
The stderr output is ``` Loading with T9693_initial.hs T9693_main.hs:4:1: Same exact name in multiple name-spaces: type constructor or class ‘X’, declared at: T9693_main.hs:4:1 data constructor ‘X’, declared at: T9693_main.hs:4:1 Probable cause: you bound a unique Template Haskell name (NameU), perhaps via newName, in different name-spaces. If that's it, then -ddump-splices might be useful Reloading with T9693_modified.hs T9693_main.hs:1:1: Data constructor ‘X’ used as a type constructor ``` The strange thing is that the modified version uses (mkName "X"), which should be fine for simultaneous use in both a data constructor and type constructor. Indeed, on a fresh load, the modified version works fine. So there is some sort of state left over from the prior load when (newName "X") was used. Test Plan: testsuite/tests/th/T9693.script Reviewers: bgamari, sighingnow, RyanGlScott Reviewed By: sighingnow, RyanGlScott Subscribers: RyanGlScott, sighingnow, rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4926
Diffstat (limited to 'testsuite/tests/th/T9693_main.hs')
-rw-r--r--testsuite/tests/th/T9693_main.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/testsuite/tests/th/T9693_main.hs b/testsuite/tests/th/T9693_main.hs
new file mode 100644
index 0000000000..71e7c9a3c7
--- /dev/null
+++ b/testsuite/tests/th/T9693_main.hs
@@ -0,0 +1,4 @@
+{-# LANGUAGE TemplateHaskell #-}
+import T9693
+
+stuff