summaryrefslogtreecommitdiff
path: root/testsuite/tests/rep-poly/T18170c.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/rep-poly/T18170c.hs')
-rw-r--r--testsuite/tests/rep-poly/T18170c.hs22
1 files changed, 22 insertions, 0 deletions
diff --git a/testsuite/tests/rep-poly/T18170c.hs b/testsuite/tests/rep-poly/T18170c.hs
new file mode 100644
index 0000000000..8927ea17df
--- /dev/null
+++ b/testsuite/tests/rep-poly/T18170c.hs
@@ -0,0 +1,22 @@
+{-# LANGUAGE ScopedTypeVariables #-}
+{-# LANGUAGE KindSignatures #-}
+{-# LANGUAGE PolyKinds #-}
+{-# LANGUAGE TemplateHaskell #-}
+{-# LANGUAGE FlexibleContexts #-}
+
+module T18170c where
+
+import Language.Haskell.TH.Lib
+
+import GHC.Exts
+import GHC.Types
+
+import Unsafe.Coerce
+
+-- Representation-polymorphism should be allowed here
+-- as long as 'r1' is monomorphised at splice site.
+repPolyApp
+ :: forall r1 r2 (a :: TYPE r1) (b :: TYPE r2)
+ . CodeQ ( (a -> b) -> a -> b )
+repPolyApp = [|| \ f x -> f x ||]
+