summaryrefslogtreecommitdiff
path: root/testsuite/tests/ffi/should_fail/ccfail005.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/ffi/should_fail/ccfail005.hs')
-rw-r--r--testsuite/tests/ffi/should_fail/ccfail005.hs16
1 files changed, 16 insertions, 0 deletions
diff --git a/testsuite/tests/ffi/should_fail/ccfail005.hs b/testsuite/tests/ffi/should_fail/ccfail005.hs
new file mode 100644
index 0000000000..3ba29a6d4c
--- /dev/null
+++ b/testsuite/tests/ffi/should_fail/ccfail005.hs
@@ -0,0 +1,16 @@
+
+{-# LANGUAGE TypeFamilies #-}
+
+module Ccfail005 where
+
+type family F a
+type instance F Bool = D -> IO Int
+type instance F Char = Int -> IO D
+data D = D
+
+-- These should be rejected as D isn't a type we can use with the FFI.
+-- Note that, in the signature the user writes, there aren't an
+-- "argument type" and "result type" to complain about, though.
+foreign import ccall f1 :: F Bool
+foreign import ccall f2 :: F Char
+