summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_compile/StaticPtrTypeFamily.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/typecheck/should_compile/StaticPtrTypeFamily.hs')
-rw-r--r--testsuite/tests/typecheck/should_compile/StaticPtrTypeFamily.hs17
1 files changed, 17 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_compile/StaticPtrTypeFamily.hs b/testsuite/tests/typecheck/should_compile/StaticPtrTypeFamily.hs
new file mode 100644
index 0000000000..96a776ecec
--- /dev/null
+++ b/testsuite/tests/typecheck/should_compile/StaticPtrTypeFamily.hs
@@ -0,0 +1,17 @@
+{-# LANGUAGE FlexibleContexts #-}
+{-# LANGUAGE ScopedTypeVariables #-}
+{-# LANGUAGE StaticPointers #-}
+{-# LANGUAGE TypeFamilies #-}
+
+module StaticPtrTypeFamily where
+
+import Data.Typeable
+import GHC.StaticPtr
+
+type family F a
+
+caller :: forall a. (Typeable a, Typeable (F a)) => a -> F a -> ()
+caller a fa = deRefStaticPtr (static func) a fa
+
+func :: a -> F a -> ()
+func _ _ = ()