diff options
author | Michael Karg <mgoremeier@gmail.com> | 2014-10-18 15:50:48 +0200 |
---|---|---|
committer | Herbert Valerio Riedel <hvr@gnu.org> | 2014-10-18 16:23:20 +0200 |
commit | 7369d2595a8cceebe457a44c8400828f4df87ea0 (patch) | |
tree | ec48da655bf65389768d6fee4ae6ca325f3a4fdb /testsuite | |
parent | 612f3d120c65a461a4ad7f212d67bdae005f4975 (diff) | |
download | haskell-7369d2595a8cceebe457a44c8400828f4df87ea0.tar.gz |
Remove obsolete Data.OldTypeable (#9639)
This finally removes the `Data.OldTypeable` module (which
has been deprecated in 7.8), from `base`, compiler and testsuite.
The deprecated `Typeable{1..7}` aliases in `Data.Typeable` are not
removed yet in order to give existing code a bit more time to adapt.
Reviewed By: hvr, dreixel
Differential Revision: https://phabricator.haskell.org/D311
Diffstat (limited to 'testsuite')
29 files changed, 0 insertions, 392 deletions
diff --git a/testsuite/tests/deriving/should_compile/all.T b/testsuite/tests/deriving/should_compile/all.T index af05006a88..3bf871db61 100644 --- a/testsuite/tests/deriving/should_compile/all.T +++ b/testsuite/tests/deriving/should_compile/all.T @@ -14,7 +14,6 @@ test('drv013', normal, compile, ['']) test('drv014', normal, compile, ['']) test('drv015', normal, compile, ['']) test('drv020', normal, compile, ['']) -test('drv021', normal, compile, ['']) test('drv022', normal, compile, ['']) test('deriving-1935', normal, compile, ['']) test('T2378', normal, compile, ['']) diff --git a/testsuite/tests/deriving/should_compile/drv021.hs b/testsuite/tests/deriving/should_compile/drv021.hs deleted file mode 100644 index 977372a516..0000000000 --- a/testsuite/tests/deriving/should_compile/drv021.hs +++ /dev/null @@ -1,16 +0,0 @@ -{-# OPTIONS_GHC -XDeriveDataTypeable -XStandaloneDeriving #-} - --- See Trac #1825 --- Test stand-alone deriving for Typeable --- Horridly, one needs to define instance for Typeable1 etc - -module ShouldCompile where - -import Data.OldTypeable - -data T1 a = T1 a -data T2 a b = T2 a b - -deriving instance Typeable1 T1 -deriving instance Typeable2 T2 - diff --git a/testsuite/tests/deriving/should_compile/drv021.stderr b/testsuite/tests/deriving/should_compile/drv021.stderr deleted file mode 100644 index e64989c194..0000000000 --- a/testsuite/tests/deriving/should_compile/drv021.stderr +++ /dev/null @@ -1,13 +0,0 @@ - -drv021.hs:9:1: Warning: - Module ‘Data.OldTypeable’ is deprecated: Use Data.Typeable instead - -drv021.hs:14:19: Warning: - In the use of type constructor or class ‘Typeable1’ - (imported from Data.OldTypeable, but defined in Data.OldTypeable.Internal): - Deprecated: "Use Data.Typeable.Internal instead" - -drv021.hs:15:19: Warning: - In the use of type constructor or class ‘Typeable2’ - (imported from Data.OldTypeable, but defined in Data.OldTypeable.Internal): - Deprecated: "Use Data.Typeable.Internal instead" diff --git a/testsuite/tests/deriving/should_fail/all.T b/testsuite/tests/deriving/should_fail/all.T index 99da88a55b..7700d62be1 100644 --- a/testsuite/tests/deriving/should_fail/all.T +++ b/testsuite/tests/deriving/should_fail/all.T @@ -11,7 +11,6 @@ test('drvfail009', normal, compile_fail, ['']) test('drvfail011', normal, compile_fail, ['']) test('drvfail012', normal, compile_fail, ['']) test('drvfail013', normal, compile_fail, ['']) -test('drvfail014', normal, compile_fail, ['']) test('drvfail015', normal, compile_fail, ['']) test('drvfail016', extra_clean(['drvfail016.hi-boot', 'drvfail016.o-boot']), diff --git a/testsuite/tests/deriving/should_fail/drvfail014.hs b/testsuite/tests/deriving/should_fail/drvfail014.hs deleted file mode 100644 index 117b7d54af..0000000000 --- a/testsuite/tests/deriving/should_fail/drvfail014.hs +++ /dev/null @@ -1,13 +0,0 @@ -{-# OPTIONS_GHC -XDeriveDataTypeable -XStandaloneDeriving #-} - --- See Trac #1825 - -module ShouldFail where -import Data.OldTypeable - -data T1 a = T1 a deriving( Typeable1 ) - -data T2 a b = T2 a b - -deriving instance (Typeable a, Typeable b) => Typeable (T2 a b) - -- c.f. drv021.hs diff --git a/testsuite/tests/deriving/should_fail/drvfail014.stderr b/testsuite/tests/deriving/should_fail/drvfail014.stderr deleted file mode 100644 index 56a63ff3fb..0000000000 --- a/testsuite/tests/deriving/should_fail/drvfail014.stderr +++ /dev/null @@ -1,9 +0,0 @@ - -drvfail014.hs:8:28: - Use deriving( Typeable ) on a data type declaration - In the data declaration for ‘T1’ - -drvfail014.hs:12:1: - Derived Typeable instance must be of form (Typeable2 T2) - In the stand-alone deriving instance for - ‘(Typeable a, Typeable b) => Typeable (T2 a b)’ diff --git a/testsuite/tests/safeHaskell/ghci/all.T b/testsuite/tests/safeHaskell/ghci/all.T index 2dca62efd6..c0ca23ac26 100644 --- a/testsuite/tests/safeHaskell/ghci/all.T +++ b/testsuite/tests/safeHaskell/ghci/all.T @@ -19,7 +19,6 @@ test('p12', normalise_errmsg_fun(normaliseBytestringPackage), ghci_script, ['p12.script']) test('p13', normal, ghci_script, ['p13.script']) test('p14', normal, ghci_script, ['p14.script']) -test('p15', normal, ghci_script, ['p15.script']) test('p16', normal, ghci_script, ['p16.script']) test('p17', normalise_errmsg_fun(normaliseBytestringPackage), ghci_script, ['p17.script']) diff --git a/testsuite/tests/safeHaskell/ghci/p15.script b/testsuite/tests/safeHaskell/ghci/p15.script deleted file mode 100644 index 81f2033ea6..0000000000 --- a/testsuite/tests/safeHaskell/ghci/p15.script +++ /dev/null @@ -1,23 +0,0 @@ --- Test restricted functionality: Data.Typeable -:unset +s -:set -XSafe -:set -XDeriveDataTypeable -:set -XStandaloneDeriving - -:m + Data.OldTypeable - -data H = H {h :: String} deriving (Typeable, Show) - -data G = G [Int] deriving (Show) - -instance Typeable G where { typeOf _ = typeOf (undefined :: H) } - -let x = H "Hello" -let y = G [0] - -x -y - -let (Just y_as_H) = (cast y) :: Maybe H -y_as_H - diff --git a/testsuite/tests/safeHaskell/ghci/p15.stderr b/testsuite/tests/safeHaskell/ghci/p15.stderr deleted file mode 100644 index 55b5d4beae..0000000000 --- a/testsuite/tests/safeHaskell/ghci/p15.stderr +++ /dev/null @@ -1,20 +0,0 @@ - -Top level: Warning: - Module ‘Data.OldTypeable’ is deprecated: Use Data.Typeable instead - -<interactive>:10:36: Warning: - In the use of type constructor or class ‘Typeable’ - (imported from Data.OldTypeable, but defined in Data.OldTypeable.Internal): - Deprecated: "Use Data.Typeable.Internal instead" - -<interactive>:14:10: - Typeable instances can only be derived in Safe Haskell. - Replace the following instance: - instance [safe] Typeable G - -<interactive>:22:22: - No instance for (Typeable G) arising from a use of ‘cast’ - In the expression: (cast y) :: Maybe H - In a pattern binding: (Just y_as_H) = (cast y) :: Maybe H - -<interactive>:23:1: Not in scope: ‘y_as_H’ diff --git a/testsuite/tests/safeHaskell/ghci/p15.stdout b/testsuite/tests/safeHaskell/ghci/p15.stdout deleted file mode 100644 index 40b3f68882..0000000000 --- a/testsuite/tests/safeHaskell/ghci/p15.stdout +++ /dev/null @@ -1,2 +0,0 @@ -H {h = "Hello"} -G [0] diff --git a/testsuite/tests/safeHaskell/safeInfered/UnsafeInfered07.hs b/testsuite/tests/safeHaskell/safeInfered/UnsafeInfered07.hs deleted file mode 100644 index dd6a830239..0000000000 --- a/testsuite/tests/safeHaskell/safeInfered/UnsafeInfered07.hs +++ /dev/null @@ -1,5 +0,0 @@ -{-# LANGUAGE Safe #-} -module UnsafeInfered07 where - -import safe UnsafeInfered07_A - diff --git a/testsuite/tests/safeHaskell/safeInfered/UnsafeInfered07.stderr b/testsuite/tests/safeHaskell/safeInfered/UnsafeInfered07.stderr deleted file mode 100644 index 153ba0f77e..0000000000 --- a/testsuite/tests/safeHaskell/safeInfered/UnsafeInfered07.stderr +++ /dev/null @@ -1,24 +0,0 @@ -[1 of 2] Compiling UnsafeInfered07_A ( UnsafeInfered07_A.hs, UnsafeInfered07_A.o ) - -UnsafeInfered07_A.hs:4:1: Warning: - Module ‘Data.OldTypeable’ is deprecated: Use Data.Typeable instead - -UnsafeInfered07_A.hs:8:10: Warning: - In the use of type constructor or class ‘Typeable’ - (imported from Data.OldTypeable, but defined in Data.OldTypeable.Internal): - Deprecated: "Use Data.Typeable.Internal instead" - -UnsafeInfered07_A.hs:8:10: Warning: - In the use of type constructor or class ‘Typeable’ - (imported from Data.OldTypeable, but defined in Data.OldTypeable.Internal): - Deprecated: "Use Data.Typeable.Internal instead" - -UnsafeInfered07_A.hs:9:16: Warning: - In the use of ‘typeOf’ - (imported from Data.OldTypeable, but defined in Data.OldTypeable.Internal): - Deprecated: "Use Data.Typeable.Internal instead" -[2 of 2] Compiling UnsafeInfered07 ( UnsafeInfered07.hs, UnsafeInfered07.o ) - -UnsafeInfered07.hs:4:1: - UnsafeInfered07_A: Can't be safely imported! - The module itself isn't safe. diff --git a/testsuite/tests/safeHaskell/safeInfered/UnsafeInfered07_A.hs b/testsuite/tests/safeHaskell/safeInfered/UnsafeInfered07_A.hs deleted file mode 100644 index 9bd6b452dd..0000000000 --- a/testsuite/tests/safeHaskell/safeInfered/UnsafeInfered07_A.hs +++ /dev/null @@ -1,10 +0,0 @@ --- | Unsafe as hand crafts a typeable instance -module UnsafeInfered07_A where - -import Data.OldTypeable - -data G = G Int - -instance Typeable G where - typeOf _ = typeOf (undefined::Int) - diff --git a/testsuite/tests/safeHaskell/safeInfered/all.T b/testsuite/tests/safeHaskell/safeInfered/all.T index a995c76c6d..887ff683a8 100644 --- a/testsuite/tests/safeHaskell/safeInfered/all.T +++ b/testsuite/tests/safeHaskell/safeInfered/all.T @@ -42,9 +42,6 @@ test('UnsafeInfered05', test('UnsafeInfered06', [ extra_clean(['UnsafeInfered06_A.hi', 'UnsafeInfered06_A.o']) ], multimod_compile_fail, ['UnsafeInfered06', '']) -test('UnsafeInfered07', - [ extra_clean(['UnsafeInfered07_A.hi', 'UnsafeInfered07_A.o']) ], - multimod_compile_fail, ['UnsafeInfered07', '']) test('UnsafeInfered08', [ extra_clean(['UnsafeInfered08_A.hi', 'UnsafeInfered08_A.o']) ], multimod_compile_fail, ['UnsafeInfered08', '']) diff --git a/testsuite/tests/safeHaskell/safeLanguage/SafeLang13.hs b/testsuite/tests/safeHaskell/safeLanguage/SafeLang13.hs deleted file mode 100644 index e11b61658a..0000000000 --- a/testsuite/tests/safeHaskell/safeLanguage/SafeLang13.hs +++ /dev/null @@ -1,41 +0,0 @@ -{-# LANGUAGE DeriveDataTypeable, StandaloneDeriving #-} --- | This shows how to use typeable to perform unsafe --- casts. Basically its an example of what Safe Haskell --- should disallow. SafeLang14 will do that. -module Main where - -import SafeLang13_A -import Data.OldTypeable - -data H = H String deriving (Typeable, Show) - -data G = G Int deriving (Show) - -instance Typeable G where - typeOf _ = typeOf (undefined :: H) - -instance Typeable P where - typeOf _ = typeOf (undefined :: G) - -{- -deriving instance Typeable G - -deriving instance Typeable P --} - -main = do - let h = H "Hello World" - g = G 1 --- Just h' = (cast h) :: Maybe G - Just p' = (cast p) :: Maybe G - Just px = (cast $ incrG p') :: Maybe P - putStrLn $ show h - putStrLn $ show g --- putStrLn $ show h' - putStrLn $ showP p - putStrLn $ show p' - putStrLn $ showP px - -incrG :: G -> G -incrG (G n) = G $ n + 1 - diff --git a/testsuite/tests/safeHaskell/safeLanguage/SafeLang13.stdout b/testsuite/tests/safeHaskell/safeLanguage/SafeLang13.stdout deleted file mode 100644 index 0be38993da..0000000000 --- a/testsuite/tests/safeHaskell/safeLanguage/SafeLang13.stdout +++ /dev/null @@ -1,5 +0,0 @@ -H "Hello World" -G 1 -Should be 3 := 3 -G 3 -Should be 3 := 4 diff --git a/testsuite/tests/safeHaskell/safeLanguage/SafeLang13_A.hs b/testsuite/tests/safeHaskell/safeLanguage/SafeLang13_A.hs deleted file mode 100644 index c49b085502..0000000000 --- a/testsuite/tests/safeHaskell/safeLanguage/SafeLang13_A.hs +++ /dev/null @@ -1,19 +0,0 @@ -module SafeLang13_A (IsoInt, h, showH, P, p, showP) where - -newtype IsoInt = I Int - -h :: IsoInt -h = I 2 - -showH :: String -showH = let I n = h - in show n - -data P = P Int - -p :: P -p = P 3 - -showP :: P -> String -showP (P n) = "Should be 3 := " ++ show n - diff --git a/testsuite/tests/safeHaskell/safeLanguage/SafeLang14.hs b/testsuite/tests/safeHaskell/safeLanguage/SafeLang14.hs deleted file mode 100644 index 98e29fbceb..0000000000 --- a/testsuite/tests/safeHaskell/safeLanguage/SafeLang14.hs +++ /dev/null @@ -1,41 +0,0 @@ -{-# LANGUAGE DeriveDataTypeable, StandaloneDeriving #-} --- | This shows how to use typeable to perform unsafe --- casts. Basically its an example of what Safe Haskell --- should disallow. SafeLang14 will do that. -module Main where - -import SafeLang14_A -import Data.OldTypeable - -data H = H String deriving (Typeable, Show) - -data G = G Int deriving (Show) - -instance Typeable G where - typeOf _ = typeOf (undefined :: H) - -instance Typeable P where - typeOf _ = typeOf (undefined :: G) - -{- -deriving instance Typeable G - -deriving instance Typeable P --} - -main = do - let h = H "Hello World" - g = G 1 --- Just h' = (cast h) :: Maybe G - Just p' = (cast p) :: Maybe G - Just px = (cast $ incrG p') :: Maybe P - putStrLn $ show h - putStrLn $ show g --- putStrLn $ show h' - putStrLn $ showP p - putStrLn $ show p' - putStrLn $ showP px - -incrG :: G -> G -incrG (G n) = G $ n + 1 - diff --git a/testsuite/tests/safeHaskell/safeLanguage/SafeLang14.stderr b/testsuite/tests/safeHaskell/safeLanguage/SafeLang14.stderr deleted file mode 100644 index c0f94d5490..0000000000 --- a/testsuite/tests/safeHaskell/safeLanguage/SafeLang14.stderr +++ /dev/null @@ -1,12 +0,0 @@ -[1 of 2] Compiling SafeLang14_A ( SafeLang14_A.hs, SafeLang14_A.o ) -[2 of 2] Compiling Main ( SafeLang14.hs, SafeLang14.o ) - -SafeLang14.hs:14:10: - Typeable instances can only be derived in Safe Haskell. - Replace the following instance: - instance [safe] Typeable G - -SafeLang14.hs:17:10: - Typeable instances can only be derived in Safe Haskell. - Replace the following instance: - instance [safe] Typeable P diff --git a/testsuite/tests/safeHaskell/safeLanguage/SafeLang14_A.hs b/testsuite/tests/safeHaskell/safeLanguage/SafeLang14_A.hs deleted file mode 100644 index d357db9107..0000000000 --- a/testsuite/tests/safeHaskell/safeLanguage/SafeLang14_A.hs +++ /dev/null @@ -1,19 +0,0 @@ -module SafeLang14_A (IsoInt, h, showH, P, p, showP) where - -newtype IsoInt = I Int - -h :: IsoInt -h = I 2 - -showH :: String -showH = let I n = h - in show n - -data P = P Int - -p :: P -p = P 3 - -showP :: P -> String -showP (P n) = "Should be 3 := " ++ show n - diff --git a/testsuite/tests/safeHaskell/safeLanguage/all.T b/testsuite/tests/safeHaskell/safeLanguage/all.T index 5932348594..131778bf52 100644 --- a/testsuite/tests/safeHaskell/safeLanguage/all.T +++ b/testsuite/tests/safeHaskell/safeLanguage/all.T @@ -39,14 +39,6 @@ test('SafeLang11', multimod_compile_and_run, ['SafeLang11', config.ghc_th_way_flags]) test('SafeLang12', normal, multimod_compile_fail, ['SafeLang12', '']) -test('SafeLang13', - extra_clean(['SafeLang13_A.o', 'SafeLang13_A.hi']), - multimod_compile_and_run, - ['SafeLang13', '']) -test('SafeLang14', - extra_clean(['SafeLang14_A.o', 'SafeLang14_A.hi']), - multimod_compile_fail, - ['SafeLang14', '-XSafe']) test('SafeLang15', [exit_code(1), extra_clean(['SafeLang15_A.o', 'SafeLang15_A.hi'])], diff --git a/testsuite/tests/safeHaskell/unsafeLibs/BadImport02.hs b/testsuite/tests/safeHaskell/unsafeLibs/BadImport02.hs deleted file mode 100644 index 80eba6288f..0000000000 --- a/testsuite/tests/safeHaskell/unsafeLibs/BadImport02.hs +++ /dev/null @@ -1,27 +0,0 @@ -{-# LANGUAGE StandaloneDeriving, DeriveDataTypeable #-} - --- | Here we used typeable to produce an illegal value -module Main where - -import Data.OldTypeable - -import BadImport02_A - -deriving instance Typeable Nat - -data NInt = NInt Int deriving Show - -instance Typeable NInt where - typeOf _ = typeOf (undefined::Nat) - -main = do - let a = succ' $ zero - Just n@(NInt z) = (cast a) :: Maybe NInt - n' = NInt (-z) - Just m = (cast n') :: Maybe Nat - - putStrLn $ showNat a - putStrLn $ show n - putStrLn $ showNat m - return () - diff --git a/testsuite/tests/safeHaskell/unsafeLibs/BadImport02.stderr b/testsuite/tests/safeHaskell/unsafeLibs/BadImport02.stderr deleted file mode 100644 index e69de29bb2..0000000000 --- a/testsuite/tests/safeHaskell/unsafeLibs/BadImport02.stderr +++ /dev/null diff --git a/testsuite/tests/safeHaskell/unsafeLibs/BadImport02.stdout b/testsuite/tests/safeHaskell/unsafeLibs/BadImport02.stdout deleted file mode 100644 index c0f565d07c..0000000000 --- a/testsuite/tests/safeHaskell/unsafeLibs/BadImport02.stdout +++ /dev/null @@ -1,3 +0,0 @@ -Nat 1 -NInt 1 -Nat -1 diff --git a/testsuite/tests/safeHaskell/unsafeLibs/BadImport02_A.hs b/testsuite/tests/safeHaskell/unsafeLibs/BadImport02_A.hs deleted file mode 100644 index 2ca43343eb..0000000000 --- a/testsuite/tests/safeHaskell/unsafeLibs/BadImport02_A.hs +++ /dev/null @@ -1,16 +0,0 @@ -{-# LANGUAGE Trustworthy #-} -module BadImport02_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 - diff --git a/testsuite/tests/safeHaskell/unsafeLibs/BadImport03.hs b/testsuite/tests/safeHaskell/unsafeLibs/BadImport03.hs deleted file mode 100644 index 9c06d34bab..0000000000 --- a/testsuite/tests/safeHaskell/unsafeLibs/BadImport03.hs +++ /dev/null @@ -1,29 +0,0 @@ -{-# LANGUAGE Safe #-} -{-# LANGUAGE StandaloneDeriving, DeriveDataTypeable #-} - --- | Here we used typeable to produce an illegal value --- Now using SAFE though so will fail -module Main where - -import Data.OldTypeable - -import BadImport03_A - -deriving instance Typeable Nat - -data NInt = NInt Int deriving Show - -instance Typeable NInt where - typeOf _ = typeOf (undefined::Nat) - -main = do - let a = succ' $ zero - Just n@(NInt z) = (cast a) :: Maybe NInt - n' = NInt (-z) - Just m = (cast n') :: Maybe Nat - - putStrLn $ showNat a - putStrLn $ show n - putStrLn $ showNat m - return () - diff --git a/testsuite/tests/safeHaskell/unsafeLibs/BadImport03.stderr b/testsuite/tests/safeHaskell/unsafeLibs/BadImport03.stderr deleted file mode 100644 index d32e33f78f..0000000000 --- a/testsuite/tests/safeHaskell/unsafeLibs/BadImport03.stderr +++ /dev/null @@ -1,7 +0,0 @@ -[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: - Typeable instances can only be derived in Safe Haskell. - Replace the following instance: - instance [safe] Typeable NInt diff --git a/testsuite/tests/safeHaskell/unsafeLibs/BadImport03_A.hs b/testsuite/tests/safeHaskell/unsafeLibs/BadImport03_A.hs deleted file mode 100644 index 1ae36bf97d..0000000000 --- a/testsuite/tests/safeHaskell/unsafeLibs/BadImport03_A.hs +++ /dev/null @@ -1,16 +0,0 @@ -{-# 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 - diff --git a/testsuite/tests/safeHaskell/unsafeLibs/all.T b/testsuite/tests/safeHaskell/unsafeLibs/all.T index 605f7de3c5..4ed5aab700 100644 --- a/testsuite/tests/safeHaskell/unsafeLibs/all.T +++ b/testsuite/tests/safeHaskell/unsafeLibs/all.T @@ -19,14 +19,6 @@ test('Dep10', normal, compile_fail, ['']) # check unsafe modules are marked unsafe test('BadImport01', normal, compile_fail, ['']) -test('BadImport02', - extra_clean(['BadImport02_A.o', 'BadImport02_A.hi']), - multimod_compile_and_run, - ['BadImport02', '']) -test('BadImport03', - extra_clean(['BadImport03_A.o', 'BadImport03_A.hi']), - multimod_compile_fail, - ['BadImport03', '']) test('BadImport05', normal, compile_fail, ['']) test('BadImport06', normal, compile_fail, ['']) test('BadImport07', normal, compile_fail, ['']) |