Stop BadImport03 using BadImport02's sources
authorIan Lynagh <igloo@earth.li>
Thu, 1 Sep 2011 21:46:44 +0000 (22:46 +0100)
committerIan Lynagh <igloo@earth.li>
Thu, 1 Sep 2011 21:46:44 +0000 (22:46 +0100)
Could have caused test failures if they both ran in parallel.

testsuite/tests/safeHaskell/unsafeLibs/BadImport03.hs
testsuite/tests/safeHaskell/unsafeLibs/BadImport03.stderr
testsuite/tests/safeHaskell/unsafeLibs/BadImport03_A.hs [new file with mode: 0644]

index 835009a..9b8a565 100644 (file)
@@ -7,7 +7,7 @@ module Main where
 
 import Data.Typeable
 
-import BadImport02_A
+import BadImport03_A
 
 deriving instance Typeable Nat
 
index 54bb8ee..03b8028 100644 (file)
@@ -1,4 +1,4 @@
-[1 of 2] Compiling BadImport02_A    ( BadImport02_A.hs, BadImport02_A.o )
+[1 of 2] Compiling BadImport03_A    ( BadImport03_A.hs, BadImport03_A.o )
 [2 of 2] Compiling Main             ( BadImport03.hs, BadImport03.o )
 
 BadImport03.hs:16:10:
diff --git a/testsuite/tests/safeHaskell/unsafeLibs/BadImport03_A.hs b/testsuite/tests/safeHaskell/unsafeLibs/BadImport03_A.hs
new file mode 100644 (file)
index 0000000..1ae36bf
--- /dev/null
@@ -0,0 +1,16 @@
+{-# LANGUAGE Trustworthy #-}
+module BadImport03_A (
+        Nat, zero, succ', showNat
+  ) where
+
+data Nat = NatC Int
+
+zero :: Nat
+zero = NatC 0
+
+succ' :: Nat -> Nat
+succ' (NatC n) = NatC $ n + 1
+
+showNat :: Nat -> String
+showNat (NatC n) = "Nat " ++ show n
+