Skip to content

Commit

Permalink
Test Trac #7989
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Peyton Jones committed Jun 25, 2013
1 parent 2d0d426 commit b8749bb
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
11 changes: 11 additions & 0 deletions 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 }
15 changes: 15 additions & 0 deletions 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}
1 change: 1 addition & 0 deletions tests/typecheck/should_fail/all.T
Expand Up @@ -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, [''])

0 comments on commit b8749bb

Please sign in to comment.