diff --git a/tests/typecheck/should_fail/T7989.hs b/tests/typecheck/should_fail/T7989.hs new file mode 100644 index 000000000..9dbdd8895 --- /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 000000000..3ba815e5f --- /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 0f1f7b4c1..b6d184c1a 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, [''])