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

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/3adf20893dfd6fbd1fb3d048c94101a88a7e4ff2

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

commit 3adf20893dfd6fbd1fb3d048c94101a88a7e4ff2
Author: Simon Peyton Jones <[email protected]>
Date:   Sun Mar 4 09:38:28 2012 +0000

    Test Trac #5892

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

 tests/rename/should_fail/T5892a.hs     |   12 ++++++++++++
 tests/rename/should_fail/T5892a.stderr |   10 ++++++++++
 tests/rename/should_fail/T5892b.hs     |   11 +++++++++++
 tests/rename/should_fail/T5892b.stderr |    4 ++++
 tests/rename/should_fail/all.T         |    2 ++
 5 files changed, 39 insertions(+), 0 deletions(-)

diff --git a/tests/rename/should_fail/T5892a.hs 
b/tests/rename/should_fail/T5892a.hs
new file mode 100644
index 0000000..c0ad989
--- /dev/null
+++ b/tests/rename/should_fail/T5892a.hs
@@ -0,0 +1,12 @@
+{-# LANGUAGE RecordWildCards #-}
+{-# OPTIONS_GHC -Werror #-}
+
+module T5892a where
+
+import Data.Version ( Version( Version, versionBranch ))
+-- Not importing its field: versionTags
+
+foo :: Version -> Version
+foo (Version {..}) -- Pattern match does not bind versionTags 
+  = let versionBranch = []
+    in Version {..}   -- Hence warning here
diff --git a/tests/rename/should_fail/T5892a.stderr 
b/tests/rename/should_fail/T5892a.stderr
new file mode 100644
index 0000000..9eecad6
--- /dev/null
+++ b/tests/rename/should_fail/T5892a.stderr
@@ -0,0 +1,10 @@
+
+T5892a.hs:12:8: Warning:
+    Fields of `Version' not initialised: Data.Version.versionTags
+    In the expression: Version {..}
+    In the expression: let versionBranch = [] in Version {..}
+    In an equation for `foo':
+        foo (Version {..}) = let versionBranch = [] in Version {..}
+
+<no location info>: 
+Failing due to -Werror.
diff --git a/tests/rename/should_fail/T5892b.hs 
b/tests/rename/should_fail/T5892b.hs
new file mode 100644
index 0000000..6bcea27
--- /dev/null
+++ b/tests/rename/should_fail/T5892b.hs
@@ -0,0 +1,11 @@
+{-# LANGUAGE RecordWildCards #-}
+module T5892b where
+
+import Data.Version ( Version( Version, versionBranch ))
+-- Not importing its field: versionTags
+
+Version{..} = Version [] []
+-- Binds versionBranch only
+
+foo = T5892b.versionBranch
+bar = T5892b.versionTags
diff --git a/tests/rename/should_fail/T5892b.stderr 
b/tests/rename/should_fail/T5892b.stderr
new file mode 100644
index 0000000..10d6c36
--- /dev/null
+++ b/tests/rename/should_fail/T5892b.stderr
@@ -0,0 +1,4 @@
+
+T5892b.hs:11:7:
+    Not in scope: `T5892b.versionTags'
+    Perhaps you meant `T5892b.versionBranch' (line 7)
diff --git a/tests/rename/should_fail/all.T b/tests/rename/should_fail/all.T
index c0e4f54..c762efc 100644
--- a/tests/rename/should_fail/all.T
+++ b/tests/rename/should_fail/all.T
@@ -99,3 +99,5 @@ test('T5657', normal, compile_fail, [''])
 test('T5745',
      extra_clean(['T5745a.hi', 'T5745a.o', 'T5745b.hi', 'T5745b.o']),
      multimod_compile_fail, ['T5745', '-v0'])
+test('T5892a', normal, compile_fail, [''])
+test('T5892b', normal, compile_fail, [''])



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

Reply via email to