summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_fail/tcfail112.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/typecheck/should_fail/tcfail112.hs')
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail112.hs15
1 files changed, 15 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_fail/tcfail112.hs b/testsuite/tests/typecheck/should_fail/tcfail112.hs
new file mode 100644
index 0000000000..01dd578ab7
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/tcfail112.hs
@@ -0,0 +1,15 @@
+-- Record construction should fail statically
+-- if there are any strict fields,
+-- including in the non-record case.
+
+module ShouldFail where
+
+data S = S { x::Int, y:: ! Int }
+data T = T Int !Int
+data U = U Int Int
+
+s1 = S {} -- Bad
+s2 = S { x=3 } -- Bad
+s3 = S { y=3 } -- Ok
+t = T {} -- Bad
+u = U {} -- Ok