diff options
author | ross <unknown> | 2004-11-11 15:00:31 +0000 |
---|---|---|
committer | ross <unknown> | 2004-11-11 15:00:31 +0000 |
commit | 1fc4f8ef00db102364cfe10e4aa4573a5dd4c507 (patch) | |
tree | d24ef0ceb544d18171574bda5869156170765987 /testsuite/tests | |
parent | 059028bed3ecb215cc092e810a94c61a5d0550ac (diff) | |
download | haskell-1fc4f8ef00db102364cfe10e4aa4573a5dd4c507.tar.gz |
[project @ 2004-11-11 15:00:27 by ross]
added more module tests from the Hugs testsuite, and merged mod200 into
mod154, which tests the same thing.
Diffstat (limited to 'testsuite/tests')
81 files changed, 510 insertions, 10 deletions
diff --git a/testsuite/tests/ghc-regress/module/Mod136_A.hs b/testsuite/tests/ghc-regress/module/Mod136_A.hs new file mode 100644 index 0000000000..6c032dd2cb --- /dev/null +++ b/testsuite/tests/ghc-regress/module/Mod136_A.hs @@ -0,0 +1,3 @@ +module Mod136_A (module List) where + +import qualified List diff --git a/testsuite/tests/ghc-regress/module/Mod137_A.hs b/testsuite/tests/ghc-regress/module/Mod137_A.hs new file mode 100644 index 0000000000..db603f9c5f --- /dev/null +++ b/testsuite/tests/ghc-regress/module/Mod137_A.hs @@ -0,0 +1,6 @@ +module Mod137_A (module Char) where + +import Char +import List as Char + + diff --git a/testsuite/tests/ghc-regress/module/Mod138_A.hs b/testsuite/tests/ghc-regress/module/Mod138_A.hs new file mode 100644 index 0000000000..d990c1e6a7 --- /dev/null +++ b/testsuite/tests/ghc-regress/module/Mod138_A.hs @@ -0,0 +1,6 @@ +module Mod138_A (module Char) where + +import qualified Char +import List as Char + + diff --git a/testsuite/tests/ghc-regress/module/Mod139_A.hs b/testsuite/tests/ghc-regress/module/Mod139_A.hs new file mode 100644 index 0000000000..9114c897ad --- /dev/null +++ b/testsuite/tests/ghc-regress/module/Mod139_A.hs @@ -0,0 +1,14 @@ +module Mod139_A where + +data Foo = Bar + +class C a where + m1 :: a -> Int + +instance C Int where + m1 _ = 2 + +x = 'x' + + + diff --git a/testsuite/tests/ghc-regress/module/Mod139_B.hs b/testsuite/tests/ghc-regress/module/Mod139_B.hs new file mode 100644 index 0000000000..064a3e3034 --- /dev/null +++ b/testsuite/tests/ghc-regress/module/Mod139_B.hs @@ -0,0 +1,5 @@ +module Mod139_B ( module A ) where + +import Mod139_A as A hiding (C,Foo) + + diff --git a/testsuite/tests/ghc-regress/module/Mod140_A.hs b/testsuite/tests/ghc-regress/module/Mod140_A.hs new file mode 100644 index 0000000000..8dfd113b04 --- /dev/null +++ b/testsuite/tests/ghc-regress/module/Mod140_A.hs @@ -0,0 +1,3 @@ +module Mod140_A where + +data Foo = Bar diff --git a/testsuite/tests/ghc-regress/module/Mod141_A.hs b/testsuite/tests/ghc-regress/module/Mod141_A.hs new file mode 100644 index 0000000000..0203e07d05 --- /dev/null +++ b/testsuite/tests/ghc-regress/module/Mod141_A.hs @@ -0,0 +1,7 @@ +module Mod141_A (partition, module List) where + +import List hiding (partition) + +partition :: String +partition = "partition" + diff --git a/testsuite/tests/ghc-regress/module/Mod142_A.hs b/testsuite/tests/ghc-regress/module/Mod142_A.hs new file mode 100644 index 0000000000..a153f35f80 --- /dev/null +++ b/testsuite/tests/ghc-regress/module/Mod142_A.hs @@ -0,0 +1,3 @@ +module Mod142_A where + +x = 'y' diff --git a/testsuite/tests/ghc-regress/module/Mod143_A.hs b/testsuite/tests/ghc-regress/module/Mod143_A.hs new file mode 100644 index 0000000000..37a50468d2 --- /dev/null +++ b/testsuite/tests/ghc-regress/module/Mod143_A.hs @@ -0,0 +1,4 @@ +module Mod143_A where + +data Foo = Bar + diff --git a/testsuite/tests/ghc-regress/module/Mod145_A.hs b/testsuite/tests/ghc-regress/module/Mod145_A.hs new file mode 100644 index 0000000000..7f935aa5ea --- /dev/null +++ b/testsuite/tests/ghc-regress/module/Mod145_A.hs @@ -0,0 +1,4 @@ +module Mod145_A where + +class C2 a where + m1 :: (a,a) -> Int diff --git a/testsuite/tests/ghc-regress/module/Mod147_A.hs b/testsuite/tests/ghc-regress/module/Mod147_A.hs new file mode 100644 index 0000000000..5262ca5ebc --- /dev/null +++ b/testsuite/tests/ghc-regress/module/Mod147_A.hs @@ -0,0 +1,3 @@ +module Mod147_A(D) where + +data D = D Int diff --git a/testsuite/tests/ghc-regress/module/Mod157_A.hs b/testsuite/tests/ghc-regress/module/Mod157_A.hs new file mode 100644 index 0000000000..7e79595e30 --- /dev/null +++ b/testsuite/tests/ghc-regress/module/Mod157_A.hs @@ -0,0 +1,4 @@ +module Mod157_A (T(..)) where + +data T = A | B | C + diff --git a/testsuite/tests/ghc-regress/module/Mod157_B.hs b/testsuite/tests/ghc-regress/module/Mod157_B.hs new file mode 100644 index 0000000000..4ef8d2c0c2 --- /dev/null +++ b/testsuite/tests/ghc-regress/module/Mod157_B.hs @@ -0,0 +1,3 @@ +module Mod157_B (T(..)) where + +import Mod157_A(T(A)) diff --git a/testsuite/tests/ghc-regress/module/Mod157_C.hs b/testsuite/tests/ghc-regress/module/Mod157_C.hs new file mode 100644 index 0000000000..b770018e21 --- /dev/null +++ b/testsuite/tests/ghc-regress/module/Mod157_C.hs @@ -0,0 +1,3 @@ +module Mod157_C(T(..)) where + +import Mod157_A(T(B)) diff --git a/testsuite/tests/ghc-regress/module/Mod157_D.hs b/testsuite/tests/ghc-regress/module/Mod157_D.hs new file mode 100644 index 0000000000..1bab0e8ba3 --- /dev/null +++ b/testsuite/tests/ghc-regress/module/Mod157_D.hs @@ -0,0 +1,5 @@ +module Mod157_D(T(..)) where + +import Mod157_B(T(..)) +import Mod157_C(T(..)) + diff --git a/testsuite/tests/ghc-regress/module/Mod159_A.hs b/testsuite/tests/ghc-regress/module/Mod159_A.hs new file mode 100644 index 0000000000..396fcd8252 --- /dev/null +++ b/testsuite/tests/ghc-regress/module/Mod159_A.hs @@ -0,0 +1,13 @@ +module Mod159_A (C(..)) where + +class C a where + m1 :: a -> Int + m2 :: a -> Int + m3 :: a -> Int + +instance C Char where + m1 _ = 1 + m2 _ = 2 + m3 _ = 3 + + diff --git a/testsuite/tests/ghc-regress/module/Mod159_B.hs b/testsuite/tests/ghc-regress/module/Mod159_B.hs new file mode 100644 index 0000000000..35bfe9a2b8 --- /dev/null +++ b/testsuite/tests/ghc-regress/module/Mod159_B.hs @@ -0,0 +1,3 @@ +module Mod159_B (C(..)) where + +import Mod159_A(C(m1)) diff --git a/testsuite/tests/ghc-regress/module/Mod159_C.hs b/testsuite/tests/ghc-regress/module/Mod159_C.hs new file mode 100644 index 0000000000..ba48933f42 --- /dev/null +++ b/testsuite/tests/ghc-regress/module/Mod159_C.hs @@ -0,0 +1,3 @@ +module Mod159_C(C(..)) where + +import Mod159_A(C(m2)) diff --git a/testsuite/tests/ghc-regress/module/Mod159_D.hs b/testsuite/tests/ghc-regress/module/Mod159_D.hs new file mode 100644 index 0000000000..8731430ea6 --- /dev/null +++ b/testsuite/tests/ghc-regress/module/Mod159_D.hs @@ -0,0 +1,4 @@ +module Mod159_D(C(..)) where + +import Mod159_B(C(..)) +import Mod159_C(C(..)) diff --git a/testsuite/tests/ghc-regress/module/Mod162_A.hs b/testsuite/tests/ghc-regress/module/Mod162_A.hs new file mode 100644 index 0000000000..68a753ba65 --- /dev/null +++ b/testsuite/tests/ghc-regress/module/Mod162_A.hs @@ -0,0 +1,3 @@ +module Mod162_A where + +data T = T diff --git a/testsuite/tests/ghc-regress/module/Mod163_A.hs b/testsuite/tests/ghc-regress/module/Mod163_A.hs new file mode 100644 index 0000000000..cd5c3da328 --- /dev/null +++ b/testsuite/tests/ghc-regress/module/Mod163_A.hs @@ -0,0 +1,3 @@ +module Mod163_A where + +data C = MkC { f :: Char } diff --git a/testsuite/tests/ghc-regress/module/Mod164_A.hs b/testsuite/tests/ghc-regress/module/Mod164_A.hs new file mode 100644 index 0000000000..e2f3d8c27b --- /dev/null +++ b/testsuite/tests/ghc-regress/module/Mod164_A.hs @@ -0,0 +1,3 @@ +module Mod164_A where + +data T = D1 | D2 diff --git a/testsuite/tests/ghc-regress/module/Mod164_B.hs b/testsuite/tests/ghc-regress/module/Mod164_B.hs new file mode 100644 index 0000000000..c26e387ed8 --- /dev/null +++ b/testsuite/tests/ghc-regress/module/Mod164_B.hs @@ -0,0 +1,3 @@ +module Mod164_B where + +data S = D1 | D3 diff --git a/testsuite/tests/ghc-regress/module/Mod170_A.hs b/testsuite/tests/ghc-regress/module/Mod170_A.hs new file mode 100644 index 0000000000..3a5fb66891 --- /dev/null +++ b/testsuite/tests/ghc-regress/module/Mod170_A.hs @@ -0,0 +1,3 @@ +module Mod170_A (Type(..)) where + +data Type = Constr { field :: Int } diff --git a/testsuite/tests/ghc-regress/module/all.T b/testsuite/tests/ghc-regress/module/all.T index c60a819825..108923b0fa 100644 --- a/testsuite/tests/ghc-regress/module/all.T +++ b/testsuite/tests/ghc-regress/module/all.T @@ -171,7 +171,57 @@ test('mod132', normal, multimod_compile_fail, ['mod132', '-v0']) clean(['Mod132_A.hi', 'Mod132_A.o', 'Mod132_B.hi', 'Mod132_B.o']) test('mod133', normal, compile, ['']) test('mod134', normal, compile_fail, ['']) +test('mod135', normal, compile_fail, ['']) +test('mod136', normal, multimod_compile_fail, ['mod136', '-v0']) +clean(['Mod136_A.hi', 'Mod136_A.o']) +test('mod137', normal, multimod_compile, ['mod137', '-v0']) +clean(['Mod137_A.hi', 'Mod137_A.o']) +test('mod138', normal, multimod_compile_fail, ['mod138', '-v0']) +clean(['Mod138_A.hi', 'Mod138_A.o']) +test('mod139', normal, multimod_compile, ['mod139', '-v0']) +clean(['Mod139_A.hi', 'Mod139_A.o', 'Mod139_B.hi', 'Mod139_B.o']) +test('mod140', normal, multimod_compile, ['mod140', '-v0']) +clean(['Mod140_A.hi', 'Mod140_A.o']) +test('mod141', normal, multimod_compile, ['mod141', '-v0']) +clean(['Mod141_A.hi', 'Mod141_A.o']) +test('mod142', normal, multimod_compile_fail, ['mod142', '-v0']) +clean(['Mod142_A.hi', 'Mod142_A.o']) +test('mod143', normal, multimod_compile_fail, ['mod143', '-v0']) +clean(['Mod143_A.hi', 'Mod143_A.o']) +test('mod144', normal, compile_fail, ['']) +test('mod145', normal, multimod_compile_fail, ['mod145', '-v0']) +clean(['Mod145_A.hi', 'Mod145_A.o']) +test('mod146', normal, compile_fail, ['']) +test('mod147', normal, multimod_compile_fail, ['mod147', '-v0']) +clean(['Mod147_A.hi', 'Mod147_A.o']) +test('mod148', normal, compile, ['']) +test('mod149', normal, compile, ['']) +test('mod150', normal, compile_fail, ['']) +test('mod151', normal, compile_fail, ['']) +test('mod152', normal, compile_fail, ['']) +test('mod153', normal, compile_fail, ['']) +test('mod154', normal, compile, ['']) +test('mod155', normal, compile_fail, ['']) +test('mod156', normal, compile, ['']) +test('mod157', normal, multimod_compile, ['mod157', '-v0']) +clean(['Mod157_A.hi', 'Mod157_A.o', 'Mod157_B.hi', 'Mod157_B.o', 'Mod157_C.hi', 'Mod157_C.o']) +test('mod158', normal, compile_fail, ['']) +test('mod159', normal, multimod_compile, ['mod159', '-v0']) +clean(['Mod159_A.hi', 'Mod159_A.o', 'Mod159_B.hi', 'Mod159_B.o', 'Mod159_C.hi', 'Mod159_C.o']) +test('mod160', normal, compile_fail, ['']) +test('mod161', normal, compile_fail, ['']) +test('mod162', normal, multimod_compile, ['mod162', '-v0']) +clean(['Mod162_A.hi', 'Mod162_A.o']) +test('mod163', normal, multimod_compile, ['mod163', '-v0']) +clean(['Mod163_A.hi', 'Mod163_A.o']) +test('mod164', normal, multimod_compile_fail, ['mod164', '-v0']) +clean(['Mod164_A.hi', 'Mod164_A.o', 'Mod164_B.hi', 'Mod164_B.o']) +test('mod165', normal, compile_fail, ['']) +test('mod166', normal, compile, ['']) +test('mod167', normal, compile, ['']) +test('mod168', normal, compile, ['']) +test('mod169', normal, compile, ['']) +test('mod170', normal, multimod_compile, ['mod170', '-v0']) +clean(['Mod170_A.hi', 'Mod170_A.o']) - -# After here we have GHC-only tests (the ones above are copied from Hugs -test('mod200', normal, compile, ['']) +# After here we have GHC-only tests (the ones above are copied from Hugs) diff --git a/testsuite/tests/ghc-regress/module/mod135.hs b/testsuite/tests/ghc-regress/module/mod135.hs new file mode 100644 index 0000000000..1998049d8f --- /dev/null +++ b/testsuite/tests/ghc-regress/module/mod135.hs @@ -0,0 +1,6 @@ +-- !!! Re-exporting qualified import. +module M (module List) where + +import List as Char + + diff --git a/testsuite/tests/ghc-regress/module/mod135.stderr b/testsuite/tests/ghc-regress/module/mod135.stderr new file mode 100644 index 0000000000..ca46a2865e --- /dev/null +++ b/testsuite/tests/ghc-regress/module/mod135.stderr @@ -0,0 +1,2 @@ + +mod135.hs:2:10: Unknown module in export list: module `List' diff --git a/testsuite/tests/ghc-regress/module/mod136.hs b/testsuite/tests/ghc-regress/module/mod136.hs new file mode 100644 index 0000000000..1729eea789 --- /dev/null +++ b/testsuite/tests/ghc-regress/module/mod136.hs @@ -0,0 +1,7 @@ +-- !!! Re-exporting qualified module. +module M where + +import Mod136_A + +x = zipWith5 + diff --git a/testsuite/tests/ghc-regress/module/mod136.stderr b/testsuite/tests/ghc-regress/module/mod136.stderr new file mode 100644 index 0000000000..5f71e690e8 --- /dev/null +++ b/testsuite/tests/ghc-regress/module/mod136.stderr @@ -0,0 +1,2 @@ + +mod136.hs:6:4: Not in scope: `zipWith5' diff --git a/testsuite/tests/ghc-regress/module/mod137.hs b/testsuite/tests/ghc-regress/module/mod137.hs new file mode 100644 index 0000000000..0541e54509 --- /dev/null +++ b/testsuite/tests/ghc-regress/module/mod137.hs @@ -0,0 +1,9 @@ +-- !!! Re-exporting alias which maps to multiple mods. +module M where + +import Mod137_A + +x = zipWith5 +y = isLatin1 + + diff --git a/testsuite/tests/ghc-regress/module/mod138.hs b/testsuite/tests/ghc-regress/module/mod138.hs new file mode 100644 index 0000000000..c10487d476 --- /dev/null +++ b/testsuite/tests/ghc-regress/module/mod138.hs @@ -0,0 +1,9 @@ +-- !!! Re-exporting alias which maps to multiple mods; some qualified. +module M where + +import Mod138_A + +x = zipWith5 +y = isLatin1 + + diff --git a/testsuite/tests/ghc-regress/module/mod138.stderr b/testsuite/tests/ghc-regress/module/mod138.stderr new file mode 100644 index 0000000000..ebd972b10c --- /dev/null +++ b/testsuite/tests/ghc-regress/module/mod138.stderr @@ -0,0 +1,2 @@ + +mod138.hs:7:4: Not in scope: `isLatin1' diff --git a/testsuite/tests/ghc-regress/module/mod139.hs b/testsuite/tests/ghc-regress/module/mod139.hs new file mode 100644 index 0000000000..ae91e2b8ca --- /dev/null +++ b/testsuite/tests/ghc-regress/module/mod139.hs @@ -0,0 +1,11 @@ +-- !!! re-exporting module alias, with hiding. +module M where + +import Mod139_B + +z = Bar +a = Mod139_B.x + +y = m1 (2::Int) + + diff --git a/testsuite/tests/ghc-regress/module/mod140.hs b/testsuite/tests/ghc-regress/module/mod140.hs new file mode 100644 index 0000000000..e40de96e39 --- /dev/null +++ b/testsuite/tests/ghc-regress/module/mod140.hs @@ -0,0 +1,6 @@ +-- !!! hiding tycon _only_. +module M where + +import Mod140_A + +a = Bar diff --git a/testsuite/tests/ghc-regress/module/mod141.hs b/testsuite/tests/ghc-regress/module/mod141.hs new file mode 100644 index 0000000000..f8a65e5a8c --- /dev/null +++ b/testsuite/tests/ghc-regress/module/mod141.hs @@ -0,0 +1,7 @@ +-- !!! re-exportation to override select entities. +module M where + +import Mod141_A + +a :: String +a = partition diff --git a/testsuite/tests/ghc-regress/module/mod142.hs b/testsuite/tests/ghc-regress/module/mod142.hs new file mode 100644 index 0000000000..3be36f3fd2 --- /dev/null +++ b/testsuite/tests/ghc-regress/module/mod142.hs @@ -0,0 +1,6 @@ +-- !!! Conflicting re-exportation of var +module M (module M, module Mod142_A) where + +import Mod142_A + +x = 'x' diff --git a/testsuite/tests/ghc-regress/module/mod142.stderr b/testsuite/tests/ghc-regress/module/mod142.stderr new file mode 100644 index 0000000000..838726a2bd --- /dev/null +++ b/testsuite/tests/ghc-regress/module/mod142.stderr @@ -0,0 +1,6 @@ + +mod142.hs:2:10: + Conflicting exports for `x': + `module M' exports `M.x' defined at mod142.hs:6:0 + `module Mod142_A' exports `Mod142_A.x' imported from Mod142_A at mod142.hs:4:0-14 + (defined at ./Mod142_A.hs:3:0) diff --git a/testsuite/tests/ghc-regress/module/mod143.hs b/testsuite/tests/ghc-regress/module/mod143.hs new file mode 100644 index 0000000000..92c3d438d7 --- /dev/null +++ b/testsuite/tests/ghc-regress/module/mod143.hs @@ -0,0 +1,7 @@ +-- !!! Conflicting re-exportation of tycon +module M (module M, module Mod143_A) where + +import Mod143_A + +data Foo = Baz + diff --git a/testsuite/tests/ghc-regress/module/mod143.stderr b/testsuite/tests/ghc-regress/module/mod143.stderr new file mode 100644 index 0000000000..2f571e82fd --- /dev/null +++ b/testsuite/tests/ghc-regress/module/mod143.stderr @@ -0,0 +1,5 @@ + +mod143.hs:2:10: + Conflicting exports for `Foo': + `module M' exports `M.Foo' defined at mod143.hs:6:5 + `module Mod143_A' exports `Mod143_A.Foo' imported from Mod143_A at mod143.hs:4:0-14 diff --git a/testsuite/tests/ghc-regress/module/mod144.hs b/testsuite/tests/ghc-regress/module/mod144.hs new file mode 100644 index 0000000000..1ee9d39dc5 --- /dev/null +++ b/testsuite/tests/ghc-regress/module/mod144.hs @@ -0,0 +1,7 @@ +-- !!! Conflicting re-exportation of dcon +module M (module Mod143_A,module M) where + +import Mod143_A -- yes, this is intentionally Mod143_A + +data Foo1 = Bar + diff --git a/testsuite/tests/ghc-regress/module/mod144.stderr b/testsuite/tests/ghc-regress/module/mod144.stderr new file mode 100644 index 0000000000..54478a5ac5 --- /dev/null +++ b/testsuite/tests/ghc-regress/module/mod144.stderr @@ -0,0 +1,5 @@ + +mod144.hs:2:10: + Conflicting exports for `Bar': + `module Mod143_A' exports `Mod143_A.Bar' imported from Mod143_A at mod144.hs:4:0-14 + `module M' exports `M.Bar' defined at mod144.hs:6:12 diff --git a/testsuite/tests/ghc-regress/module/mod145.hs b/testsuite/tests/ghc-regress/module/mod145.hs new file mode 100644 index 0000000000..63c5b72a73 --- /dev/null +++ b/testsuite/tests/ghc-regress/module/mod145.hs @@ -0,0 +1,9 @@ +-- !!! Conflicting re-exportation of class methods +module Mod145(module Mod145, module Mod145_A) where + +import Mod145_A + +class C1 a where + m1 :: a -> Int + + diff --git a/testsuite/tests/ghc-regress/module/mod145.stderr b/testsuite/tests/ghc-regress/module/mod145.stderr new file mode 100644 index 0000000000..28ee344d2c --- /dev/null +++ b/testsuite/tests/ghc-regress/module/mod145.stderr @@ -0,0 +1,5 @@ + +mod145.hs:2:14: + Conflicting exports for `m1': + `module Mod145' exports `Mod145.m1' defined at mod145.hs:7:2 + `module Mod145_A' exports `Mod145_A.m1' imported from Mod145_A at mod145.hs:4:0-14 diff --git a/testsuite/tests/ghc-regress/module/mod146.hs b/testsuite/tests/ghc-regress/module/mod146.hs new file mode 100644 index 0000000000..b87f6d51cb --- /dev/null +++ b/testsuite/tests/ghc-regress/module/mod146.hs @@ -0,0 +1,8 @@ +-- !!! Conflicting re-exportation of class methods +module Mod146(module Mod146, module Mod145_A) where + +import Mod145_A + +class C1 a where + m1 :: a -> Int + diff --git a/testsuite/tests/ghc-regress/module/mod146.stderr b/testsuite/tests/ghc-regress/module/mod146.stderr new file mode 100644 index 0000000000..9ed253c203 --- /dev/null +++ b/testsuite/tests/ghc-regress/module/mod146.stderr @@ -0,0 +1,5 @@ + +mod146.hs:2:14: + Conflicting exports for `m1': + `module Mod146' exports `Mod146.m1' defined at mod146.hs:7:2 + `module Mod145_A' exports `Mod145_A.m1' imported from Mod145_A at mod146.hs:4:0-14 diff --git a/testsuite/tests/ghc-regress/module/mod147.hs b/testsuite/tests/ghc-regress/module/mod147.hs new file mode 100644 index 0000000000..0743c4cb51 --- /dev/null +++ b/testsuite/tests/ghc-regress/module/mod147.hs @@ -0,0 +1,6 @@ +-- !!! exporting tycon (but not dcon with same name.) +module M where + +import Mod147_A + +x = D 4 diff --git a/testsuite/tests/ghc-regress/module/mod147.stderr b/testsuite/tests/ghc-regress/module/mod147.stderr new file mode 100644 index 0000000000..de758b7c76 --- /dev/null +++ b/testsuite/tests/ghc-regress/module/mod147.stderr @@ -0,0 +1,2 @@ + +mod147.hs:6:4: Not in scope: data constructor `D' diff --git a/testsuite/tests/ghc-regress/module/mod148.hs b/testsuite/tests/ghc-regress/module/mod148.hs new file mode 100644 index 0000000000..77ccfef6d1 --- /dev/null +++ b/testsuite/tests/ghc-regress/module/mod148.hs @@ -0,0 +1,5 @@ +-- !!! re-exportation and ambiguity +-- should not fail as the absence of an export +-- list spec means "export all entities defined, +-- but none imported". +module M where id x = []; diff --git a/testsuite/tests/ghc-regress/module/mod149.hs b/testsuite/tests/ghc-regress/module/mod149.hs new file mode 100644 index 0000000000..e8187e1ae3 --- /dev/null +++ b/testsuite/tests/ghc-regress/module/mod149.hs @@ -0,0 +1,4 @@ +-- !!! re-exportation and ambiguity again. +-- Exporting M (=> id) is not ambiguous, as +-- Prelude isn't also exported. +module M (module M) where id x = x; diff --git a/testsuite/tests/ghc-regress/module/mod150.hs b/testsuite/tests/ghc-regress/module/mod150.hs new file mode 100644 index 0000000000..92bb4f1e67 --- /dev/null +++ b/testsuite/tests/ghc-regress/module/mod150.hs @@ -0,0 +1,2 @@ +-- !!! ambiguous re-exportation. +module M (module M,module Prelude) where id x = x; diff --git a/testsuite/tests/ghc-regress/module/mod150.stderr b/testsuite/tests/ghc-regress/module/mod150.stderr new file mode 100644 index 0000000000..0aae85eacb --- /dev/null +++ b/testsuite/tests/ghc-regress/module/mod150.stderr @@ -0,0 +1,5 @@ + +mod150.hs:2:10: + Conflicting exports for `id': + `module M' exports `M.id' defined at mod150.hs:2:41 + `module Prelude' exports `GHC.Base.id' imported from Prelude at Implicit import declaration diff --git a/testsuite/tests/ghc-regress/module/mod151.hs b/testsuite/tests/ghc-regress/module/mod151.hs new file mode 100644 index 0000000000..3bbeda508d --- /dev/null +++ b/testsuite/tests/ghc-regress/module/mod151.hs @@ -0,0 +1,2 @@ +-- !!! ambiguous re-exportation. +module M (module M,id) where id x = x; diff --git a/testsuite/tests/ghc-regress/module/mod151.stderr b/testsuite/tests/ghc-regress/module/mod151.stderr new file mode 100644 index 0000000000..26525807cb --- /dev/null +++ b/testsuite/tests/ghc-regress/module/mod151.stderr @@ -0,0 +1,5 @@ + +mod151.hs:2:19: + Ambiguous occurrence `id' + It could refer to either `M.id', defined at mod151.hs:2:29 + or `GHC.Base.id', imported from Prelude at Implicit import declaration diff --git a/testsuite/tests/ghc-regress/module/mod152.hs b/testsuite/tests/ghc-regress/module/mod152.hs new file mode 100644 index 0000000000..8f9911b1e5 --- /dev/null +++ b/testsuite/tests/ghc-regress/module/mod152.hs @@ -0,0 +1,2 @@ +-- !!! ambiguous re-exportation. +module M (module Prelude,id) where id x = x; diff --git a/testsuite/tests/ghc-regress/module/mod152.stderr b/testsuite/tests/ghc-regress/module/mod152.stderr new file mode 100644 index 0000000000..f0635ab503 --- /dev/null +++ b/testsuite/tests/ghc-regress/module/mod152.stderr @@ -0,0 +1,10 @@ + +mod152.hs:2:10: + Conflicting exports for `id': + `module Prelude' exports `GHC.Base.id' imported from Prelude at Implicit import declaration + `id' exports `M.id' defined at mod152.hs:2:35 + +mod152.hs:2:25: + Ambiguous occurrence `id' + It could refer to either `M.id', defined at mod152.hs:2:35 + or `GHC.Base.id', imported from Prelude at Implicit import declaration diff --git a/testsuite/tests/ghc-regress/module/mod153.hs b/testsuite/tests/ghc-regress/module/mod153.hs new file mode 100644 index 0000000000..ee50c89bda --- /dev/null +++ b/testsuite/tests/ghc-regress/module/mod153.hs @@ -0,0 +1,2 @@ +-- !!! ambiguous re-exportation. +module M (id) where id x = x; diff --git a/testsuite/tests/ghc-regress/module/mod153.stderr b/testsuite/tests/ghc-regress/module/mod153.stderr new file mode 100644 index 0000000000..16540b1a83 --- /dev/null +++ b/testsuite/tests/ghc-regress/module/mod153.stderr @@ -0,0 +1,5 @@ + +mod153.hs:2:10: + Ambiguous occurrence `id' + It could refer to either `M.id', defined at mod153.hs:2:20 + or `GHC.Base.id', imported from Prelude at Implicit import declaration diff --git a/testsuite/tests/ghc-regress/module/mod154.hs b/testsuite/tests/ghc-regress/module/mod154.hs new file mode 100644 index 0000000000..c96320bdad --- /dev/null +++ b/testsuite/tests/ghc-regress/module/mod154.hs @@ -0,0 +1,9 @@ +-- !!! Default export list isn't the same as (module M) +-- This should succeed, exporting only the local 'sort', +-- and not being confused by the 'sort' from 'List'. +-- (Hugs gets this wrong) + +module M where + +import List as M +sort = "foo" diff --git a/testsuite/tests/ghc-regress/module/mod155.hs b/testsuite/tests/ghc-regress/module/mod155.hs new file mode 100644 index 0000000000..4b94525439 --- /dev/null +++ b/testsuite/tests/ghc-regress/module/mod155.hs @@ -0,0 +1,5 @@ +-- !!! ambiguous re-exportation. +module M(module M) where + +import Prelude as M +id x = x diff --git a/testsuite/tests/ghc-regress/module/mod155.stderr b/testsuite/tests/ghc-regress/module/mod155.stderr new file mode 100644 index 0000000000..2619235814 --- /dev/null +++ b/testsuite/tests/ghc-regress/module/mod155.stderr @@ -0,0 +1,5 @@ + +mod155.hs:2:9: + Conflicting exports for `id': + `module M' exports `M.id' defined at mod155.hs:5:0 + `module M' exports `GHC.Base.id' imported from Prelude at mod155.hs:4:0-18 diff --git a/testsuite/tests/ghc-regress/module/mod156.hs b/testsuite/tests/ghc-regress/module/mod156.hs new file mode 100644 index 0000000000..20c2884425 --- /dev/null +++ b/testsuite/tests/ghc-regress/module/mod156.hs @@ -0,0 +1,2 @@ +-- !!! non-ambiguous re-exportation. +module M (module Prelude) where id x = x; diff --git a/testsuite/tests/ghc-regress/module/mod157.hs b/testsuite/tests/ghc-regress/module/mod157.hs new file mode 100644 index 0000000000..582e1a708b --- /dev/null +++ b/testsuite/tests/ghc-regress/module/mod157.hs @@ -0,0 +1,13 @@ +-- !!! cumulative re-exportation of data constructors +module M where + +import Mod157_D + +-- Mod157_D re-exports the type T using (..). T is defined +-- in Mod157_A, but (only) two of its constructors are visible +-- in Mod157_D, one via Mod157_B, the other via Mod157_C. +a = A +b = B + + + diff --git a/testsuite/tests/ghc-regress/module/mod158.hs b/testsuite/tests/ghc-regress/module/mod158.hs new file mode 100644 index 0000000000..611ec04f03 --- /dev/null +++ b/testsuite/tests/ghc-regress/module/mod158.hs @@ -0,0 +1,14 @@ +-- !!! cumulative re-exportation of data constructors, pt 2. +module M where + +import Mod157_D + +-- Mod157_D re-exports the type T using (..). T is defined +-- in Mod157_A, but (only) two of its constructors is visible +-- in Mod157_D, one via Mod157_B, the other via Mod157_C. +a = A +b = B +-- C is out of scope. +c = C + + diff --git a/testsuite/tests/ghc-regress/module/mod158.stderr b/testsuite/tests/ghc-regress/module/mod158.stderr new file mode 100644 index 0000000000..e9fc39a574 --- /dev/null +++ b/testsuite/tests/ghc-regress/module/mod158.stderr @@ -0,0 +1,2 @@ + +mod158.hs:12:4: Not in scope: data constructor `C' diff --git a/testsuite/tests/ghc-regress/module/mod159.hs b/testsuite/tests/ghc-regress/module/mod159.hs new file mode 100644 index 0000000000..f858d03f30 --- /dev/null +++ b/testsuite/tests/ghc-regress/module/mod159.hs @@ -0,0 +1,10 @@ +-- !!! cumulative re-exportation of class methods +module M where + +import Mod159_D + +-- Mod159_D re-exports the class C using (..). C is defined +-- in Mod159_A, but (only) two of its methods are visible +-- in Mod159_D, one via Mod159_B, the other via Mod159_C. +a = m1 'a' +b = m2 'b' diff --git a/testsuite/tests/ghc-regress/module/mod160.hs b/testsuite/tests/ghc-regress/module/mod160.hs new file mode 100644 index 0000000000..a279471c11 --- /dev/null +++ b/testsuite/tests/ghc-regress/module/mod160.hs @@ -0,0 +1,12 @@ +-- !!! cumulative re-exportation of class methods, pt 2. +module M where + +import Mod159_D + +-- Mod159_D re-exports the class C using (..). C is defined +-- in Mod159_A, but (only) two of its methods are visible +-- in Mod159_D, one via Mod159_B, the other via Mod159_C. +a = m1 'a' +b = m2 'b' +-- m3 isn't in scope +c = m3 'c' diff --git a/testsuite/tests/ghc-regress/module/mod160.stderr b/testsuite/tests/ghc-regress/module/mod160.stderr new file mode 100644 index 0000000000..a76dead4de --- /dev/null +++ b/testsuite/tests/ghc-regress/module/mod160.stderr @@ -0,0 +1,2 @@ + +mod160.hs:12:4: Not in scope: `m3' diff --git a/testsuite/tests/ghc-regress/module/mod161.hs b/testsuite/tests/ghc-regress/module/mod161.hs new file mode 100644 index 0000000000..8e900ad72b --- /dev/null +++ b/testsuite/tests/ghc-regress/module/mod161.hs @@ -0,0 +1,3 @@ +-- !!! Testing export of unknown name +module Bar(bar) where +foo = foo
\ No newline at end of file diff --git a/testsuite/tests/ghc-regress/module/mod161.stderr b/testsuite/tests/ghc-regress/module/mod161.stderr new file mode 100644 index 0000000000..8135e16595 --- /dev/null +++ b/testsuite/tests/ghc-regress/module/mod161.stderr @@ -0,0 +1,2 @@ + +mod161.hs:2:11: Not in scope: `bar' diff --git a/testsuite/tests/ghc-regress/module/mod162.hs b/testsuite/tests/ghc-regress/module/mod162.hs new file mode 100644 index 0000000000..8164ac5354 --- /dev/null +++ b/testsuite/tests/ghc-regress/module/mod162.hs @@ -0,0 +1,6 @@ +-- !!! hiding a type (but not dcon of same name) +module M where + +import Mod162_A hiding (T()) + +x = T diff --git a/testsuite/tests/ghc-regress/module/mod163.hs b/testsuite/tests/ghc-regress/module/mod163.hs new file mode 100644 index 0000000000..f095e1af0c --- /dev/null +++ b/testsuite/tests/ghc-regress/module/mod163.hs @@ -0,0 +1,6 @@ +-- !!! lazy name conflict reporting for field labels/selectors. +module M where + +import Mod163_A + +data T = MkT { f :: Int } diff --git a/testsuite/tests/ghc-regress/module/mod164.hs b/testsuite/tests/ghc-regress/module/mod164.hs new file mode 100644 index 0000000000..f472bfdddc --- /dev/null +++ b/testsuite/tests/ghc-regress/module/mod164.hs @@ -0,0 +1,10 @@ +-- !!! lazy name conflict reporting for data constructors +module M where + +import Mod164_A +import Mod164_B + +f x = + case x of + D1 -> 'a' + diff --git a/testsuite/tests/ghc-regress/module/mod164.stderr b/testsuite/tests/ghc-regress/module/mod164.stderr new file mode 100644 index 0000000000..5ed76b5c52 --- /dev/null +++ b/testsuite/tests/ghc-regress/module/mod164.stderr @@ -0,0 +1,5 @@ + +mod164.hs:9:4: + Ambiguous occurrence `D1' + It could refer to either `Mod164_A.D1', imported from Mod164_A at mod164.hs:4:0-14 + or `Mod164_B.D1', imported from Mod164_B at mod164.hs:5:0-14 diff --git a/testsuite/tests/ghc-regress/module/mod165.hs b/testsuite/tests/ghc-regress/module/mod165.hs new file mode 100644 index 0000000000..847280ffaf --- /dev/null +++ b/testsuite/tests/ghc-regress/module/mod165.hs @@ -0,0 +1,10 @@ +-- !!! lazy name conflict reporting for data constructors (pt.2) +module M where + +import Mod164_A as A +import Mod164_B as A + +f x = + case x of + A.D1 -> 'a' + diff --git a/testsuite/tests/ghc-regress/module/mod165.stderr b/testsuite/tests/ghc-regress/module/mod165.stderr new file mode 100644 index 0000000000..85d3cdcc2d --- /dev/null +++ b/testsuite/tests/ghc-regress/module/mod165.stderr @@ -0,0 +1,5 @@ + +mod165.hs:9:4: + Ambiguous occurrence `A.D1' + It could refer to either `Mod164_A.D1', imported from Mod164_A at mod165.hs:4:0-19 + or `Mod164_B.D1', imported from Mod164_B at mod165.hs:5:0-19 diff --git a/testsuite/tests/ghc-regress/module/mod166.hs b/testsuite/tests/ghc-regress/module/mod166.hs new file mode 100644 index 0000000000..86e32cd489 --- /dev/null +++ b/testsuite/tests/ghc-regress/module/mod166.hs @@ -0,0 +1,10 @@ +-- !!! lazy name conflict reporting for data constructors (pt.3) +module M where + +import Mod164_A as A +import Mod164_B + +f x = + case x of + A.D1 -> 'a' + diff --git a/testsuite/tests/ghc-regress/module/mod167.hs b/testsuite/tests/ghc-regress/module/mod167.hs new file mode 100644 index 0000000000..520d5b1383 --- /dev/null +++ b/testsuite/tests/ghc-regress/module/mod167.hs @@ -0,0 +1,9 @@ +-- !!! qualified + hiding type constructors (or classes) +module M where + +import qualified Mod164_A hiding (T) + +data T = D1 | D3 + +f = D1 +g = Mod164_A.D1 diff --git a/testsuite/tests/ghc-regress/module/mod168.hs b/testsuite/tests/ghc-regress/module/mod168.hs new file mode 100644 index 0000000000..7a11c49fca --- /dev/null +++ b/testsuite/tests/ghc-regress/module/mod168.hs @@ -0,0 +1,20 @@ +-- !!! hiding Prelude method names +-- (based on bug report by Iavor Diatchi: +-- http://haskell.org/pipermail/hugs-bugs/2003-October/001369.html +-- ) +module M where + +import Prelude hiding ( negate, enumFrom, + enumFromThen, enumFromTo, + enumFromThenTo ) +import Ix hiding ( rangeSize ) +negate = undefined +enumFrom = undefined +enumFromThen = undefined +enumFromTo = undefined +enumFromThenTo = undefined +rangeSize = undefined + +x = [negate,enumFrom, enumFromThen, enumFromTo, enumFromThenTo, rangeSize] + + diff --git a/testsuite/tests/ghc-regress/module/mod169.hs b/testsuite/tests/ghc-regress/module/mod169.hs new file mode 100644 index 0000000000..521da07a39 --- /dev/null +++ b/testsuite/tests/ghc-regress/module/mod169.hs @@ -0,0 +1,5 @@ +-- !!! Non-clashing local binding and occurrence. +module M where + +m :: Int +m = let length _ = 5 in length [] diff --git a/testsuite/tests/ghc-regress/module/mod170.hs b/testsuite/tests/ghc-regress/module/mod170.hs new file mode 100644 index 0000000000..2a53820645 --- /dev/null +++ b/testsuite/tests/ghc-regress/module/mod170.hs @@ -0,0 +1,7 @@ +-- !! Lone import of field label +-- (contributed/reported by Ross Paterson.) +module M where + +import Mod170_A(field) + +x = field diff --git a/testsuite/tests/ghc-regress/module/mod200.hs b/testsuite/tests/ghc-regress/module/mod200.hs deleted file mode 100644 index df336eaa5b..0000000000 --- a/testsuite/tests/ghc-regress/module/mod200.hs +++ /dev/null @@ -1,7 +0,0 @@ --- Nice test from Ross: should export only the --- local 'sort', and not be confused by the 'sort' from 'List' - -module M where - -import List as M -sort = "foo"
\ No newline at end of file |