Repository : ssh://darcs.haskell.org//srv/darcs/testsuite

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/7acbfcd83bf082563f05a5d6f5cf3784fe92ee59

>---------------------------------------------------------------

commit 7acbfcd83bf082563f05a5d6f5cf3784fe92ee59
Author: Ian Lynagh <[email protected]>
Date:   Fri Sep 30 21:55:08 2011 +0100

    Add a couple more cases to ccfail004

>---------------------------------------------------------------

 tests/ffi/should_fail/ccfail004.hs     |    8 +++++++-
 tests/ffi/should_fail/ccfail004.stderr |   16 +++++++++++++---
 2 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/tests/ffi/should_fail/ccfail004.hs 
b/tests/ffi/should_fail/ccfail004.hs
index 5676d7c..1773e2e 100644
--- a/tests/ffi/should_fail/ccfail004.hs
+++ b/tests/ffi/should_fail/ccfail004.hs
@@ -3,8 +3,14 @@ module Ccfail004 where
 
 import Ccfail004A
 
--- Both these should be rejected as the NInt constructor isn't in scope
+newtype NT = NT [NT]
+
+-- All these should be rejected as the newtype constructors aren't in scope
 foreign import ccall f1 :: NInt -> IO Int
 foreign import ccall f2 :: Int -> IO NInt
 foreign import ccall f3 :: Int -> NIO Int
 
+-- Both these should be rejected as NT is recursive
+foreign import ccall f4 :: NT -> IO ()
+foreign import ccall f5 :: IO NT
+
diff --git a/tests/ffi/should_fail/ccfail004.stderr 
b/tests/ffi/should_fail/ccfail004.stderr
index 08e3f4f..cabda4e 100644
--- a/tests/ffi/should_fail/ccfail004.stderr
+++ b/tests/ffi/should_fail/ccfail004.stderr
@@ -1,16 +1,26 @@
 
-ccfail004.hs:7:1:
+ccfail004.hs:9:1:
     Unacceptable argument type in foreign declaration: NInt
     When checking declaration:
       foreign import ccall safe "static f1" f1 :: NInt -> IO Int
 
-ccfail004.hs:8:1:
+ccfail004.hs:10:1:
     Unacceptable result type in foreign declaration: IO NInt
     When checking declaration:
       foreign import ccall safe "static f2" f2 :: Int -> IO NInt
 
-ccfail004.hs:9:1:
+ccfail004.hs:11:1:
     Unacceptable result type in foreign declaration: NIO Int
     When checking declaration:
       foreign import ccall safe "static f3" f3 :: Int -> NIO Int
 
+ccfail004.hs:14:1:
+    Unacceptable argument type in foreign declaration: [NT]
+    When checking declaration:
+      foreign import ccall safe "static f4" f4 :: NT -> IO ()
+
+ccfail004.hs:15:1:
+    Unacceptable result type in foreign declaration: IO [NT]
+    When checking declaration:
+      foreign import ccall safe "static f5" f5 :: IO NT
+



_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to