diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2022-01-05 11:04:53 +0000 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-01-18 16:12:50 -0500 |
commit | 7ec783de6ba9e380da6737dad78d9a82cf56002a (patch) | |
tree | b1100a72080d85a607dd7af4dd52825151fa99db | |
parent | 310424d05836ee8788c7c79f98243ef92330f5f1 (diff) | |
download | haskell-7ec783de6ba9e380da6737dad78d9a82cf56002a.tar.gz |
Add test for using type families with static pointers
Issue was reported on #13306
-rw-r--r-- | testsuite/tests/typecheck/should_compile/StaticPtrTypeFamily.hs | 17 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_compile/all.T | 2 |
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, ['']) |