summaryrefslogtreecommitdiff
path: root/testsuite/tests/th/T10796a.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/th/T10796a.hs')
-rw-r--r--testsuite/tests/th/T10796a.hs15
1 files changed, 15 insertions, 0 deletions
diff --git a/testsuite/tests/th/T10796a.hs b/testsuite/tests/th/T10796a.hs
new file mode 100644
index 0000000000..6c1ac8c78c
--- /dev/null
+++ b/testsuite/tests/th/T10796a.hs
@@ -0,0 +1,15 @@
+{-# LANGUAGE TemplateHaskell #-}
+module T10796a where
+
+import Data.Ratio
+import Data.Set (Set, fromList)
+import Language.Haskell.TH.Syntax (liftData)
+
+-- Data instance with toConstr implemented using a variable,
+-- not a data constructor
+splicedSet :: Set Char
+splicedSet = $(liftData (fromList "test"))
+
+-- Infix data constructor
+splicedRatio :: Ratio Int
+splicedRatio = $(liftData (1 % 2 :: Ratio Int))