[commit: testsuite] master: Test Trac #7989 (b8749bb)

Simon Peyton Jones simonpj at microsoft.com
Tue Jun 25 15:14:50 CEST 2013


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

On branch  : master

https://github.com/ghc/testsuite/commit/b8749bb9919eefff91b6964055e997f1f2a85201

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

commit b8749bb9919eefff91b6964055e997f1f2a85201
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Tue Jun 25 14:14:31 2013 +0100

    Test Trac #7989

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

 tests/typecheck/should_fail/T7989.hs     |   11 +++++++++++
 tests/typecheck/should_fail/T7989.stderr |   15 +++++++++++++++
 tests/typecheck/should_fail/all.T        |    1 +
 3 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/tests/typecheck/should_fail/T7989.hs b/tests/typecheck/should_fail/T7989.hs
new file mode 100644
index 0000000..9dbdd88
--- /dev/null
+++ b/tests/typecheck/should_fail/T7989.hs
@@ -0,0 +1,11 @@
+module T7989 where
+
+data A = A {a0, a1 :: Int}
+data B = B {b0, b1 :: Int}
+
+f x = x { a0 = 3, a1 = 2, b0 = 4, b1 = 5 }
+
+data T = T1 { x,y,v :: Int} | T2 { y,z,v :: Int } | T3 { z,x,v :: Int}
+g a = a { x=0, y=0, z=0, v=0 }
+
+h a = a { x=0, a0=0 }
\ No newline at end of file
diff --git a/tests/typecheck/should_fail/T7989.stderr b/tests/typecheck/should_fail/T7989.stderr
new file mode 100644
index 0000000..3ba815e
--- /dev/null
+++ b/tests/typecheck/should_fail/T7989.stderr
@@ -0,0 +1,15 @@
+
+T7989.hs:6:7:
+    No constructor has all these fields: ‛a0’, ‛b0’
+    In the expression: x {a0 = 3, a1 = 2, b0 = 4, b1 = 5}
+    In an equation for ‛f’: f x = x {a0 = 3, a1 = 2, b0 = 4, b1 = 5}
+
+T7989.hs:9:7:
+    No constructor has all these fields: ‛x’, ‛y’, ‛z’
+    In the expression: a {x = 0, y = 0, z = 0, v = 0}
+    In an equation for ‛g’: g a = a {x = 0, y = 0, z = 0, v = 0}
+
+T7989.hs:11:7:
+    No constructor has all these fields: ‛x’, ‛a0’
+    In the expression: a {x = 0, a0 = 0}
+    In an equation for ‛h’: h a = a {x = 0, a0 = 0}
diff --git a/tests/typecheck/should_fail/all.T b/tests/typecheck/should_fail/all.T
index 0f1f7b4..b6d184c 100644
--- a/tests/typecheck/should_fail/all.T
+++ b/tests/typecheck/should_fail/all.T
@@ -310,3 +310,4 @@ test('T7856', normal, compile_fail, [''])
 test('T7869', normal, compile_fail, [''])
 test('T7892', normal, compile_fail, [''])
 test('T7809', normal, compile_fail, [''])
+test('T7989', normal, compile_fail, [''])





More information about the ghc-commits mailing list