[project @ 1999-09-26 16:05:34 by sof]
authorsof <unknown>
Sun, 26 Sep 1999 16:05:35 +0000 (16:05 +0000)
committersof <unknown>
Sun, 26 Sep 1999 16:05:35 +0000 (16:05 +0000)
Record construction tests

ghc/tests/typecheck/should_fail/tcfail084.hs [new file with mode: 0644]
ghc/tests/typecheck/should_fail/tcfail084.stderr [new file with mode: 0644]
ghc/tests/typecheck/should_fail/tcfail085.hs [new file with mode: 0644]
ghc/tests/typecheck/should_fail/tcfail085.stderr [new file with mode: 0644]

diff --git a/ghc/tests/typecheck/should_fail/tcfail084.hs b/ghc/tests/typecheck/should_fail/tcfail084.hs
new file mode 100644 (file)
index 0000000..22b5456
--- /dev/null
@@ -0,0 +1,11 @@
+-- !!! Check that using a label belonging to another constructor
+-- !!! is flagged as being incorrect.
+module ShouldFail where
+
+data F
+ = F { x :: Int }
+ | G { y :: Int }
+
+z :: F
+z = F { y = 2 }
+
diff --git a/ghc/tests/typecheck/should_fail/tcfail084.stderr b/ghc/tests/typecheck/should_fail/tcfail084.stderr
new file mode 100644 (file)
index 0000000..5e54fb2
--- /dev/null
@@ -0,0 +1,7 @@
+
+tcfail084.hs:10:
+    Constructor `F' does not have field `y'
+    In the right-hand side of a pattern binding: F {y = 2}
+
+Compilation had errors
+
diff --git a/ghc/tests/typecheck/should_fail/tcfail085.hs b/ghc/tests/typecheck/should_fail/tcfail085.hs
new file mode 100644 (file)
index 0000000..81036b9
--- /dev/null
@@ -0,0 +1,10 @@
+-- !!! Check that not supplying bindings for strict fields
+-- !!! is flagged as being incorrect.
+module ShouldFail where
+
+data F
+ = F { x :: Int, y :: !Int }
+
+z :: F
+z = F { x = 2 }
+
diff --git a/ghc/tests/typecheck/should_fail/tcfail085.stderr b/ghc/tests/typecheck/should_fail/tcfail085.stderr
new file mode 100644 (file)
index 0000000..2fc211d
--- /dev/null
@@ -0,0 +1,7 @@
+
+tcfail085.hs:9:
+    Constructor `F' does not have the required strict field `y'
+    In the right-hand side of a pattern binding: F {x = 2}
+
+Compilation had errors
+