summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2022-01-05 11:04:53 +0000
committerMatthew Pickering <matthewtpickering@gmail.com>2022-01-17 17:05:27 +0000
commit77041f3f151f540dd2dfe6fdff979e682d130025 (patch)
treeb8bbaffdde9d0ba16f2298be83849167bdb995bd
parent9b148a0811a9b39cac3940220f76da03be53dca6 (diff)
downloadhaskell-wip/mp-fix-static-type.tar.gz
Add test for using type families with static pointerswip/mp-fix-static-type
Issue was reported on #13306
-rw-r--r--testsuite/tests/typecheck/should_compile/StaticPtrTypeFamily.hs17
-rw-r--r--testsuite/tests/typecheck/should_compile/all.T2
2 files changed, 18 insertions, 1 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 _ _ = ()
diff --git a/testsuite/tests/typecheck/should_compile/all.T b/testsuite/tests/typecheck/should_compile/all.T
index 8b31c8b3cc..4da7a858cb 100644
--- a/testsuite/tests/typecheck/should_compile/all.T
+++ b/testsuite/tests/typecheck/should_compile/all.T
@@ -804,6 +804,6 @@ test('T20584b', normal, compile, [''])
test('T20588b', [extra_files(['T20588b.hs', 'T20588b.hs-boot', 'T20588b_aux.hs'])], multimod_compile, ['T20588b_aux.hs', '-v0'])
test('T20588d', [extra_files(['T20588d.hs', 'T20588d.hs-boot', 'T20588d_aux.hs'])], multimod_compile, ['T20588d_aux.hs', '-v0'])
test('T20661', [extra_files(['T20661.hs', 'T20661.hs-boot', 'T20661_aux.hs'])], multimod_compile, ['T20661_aux.hs', '-v0'])
-
test('T20873', normal, compile, [''])
test('T20873b', [extra_files(['T20873b_aux.hs'])], multimod_compile, ['T20873b', '-v0'])
+test('StaticPtrTypeFamily', normal, compile, [''])