[project @ 1998-02-12 14:19:12 by simonm]
authorsimonm <unknown>
Thu, 12 Feb 1998 14:19:13 +0000 (14:19 +0000)
committersimonm <unknown>
Thu, 12 Feb 1998 14:19:13 +0000 (14:19 +0000)
test for newtype declaration with an unboxed field.

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

diff --git a/ghc/tests/typecheck/should_fail/tcfail079.hs b/ghc/tests/typecheck/should_fail/tcfail079.hs
new file mode 100644 (file)
index 0000000..273ddfc
--- /dev/null
@@ -0,0 +1,11 @@
+{-# OPTIONS -fglasgow-exts #-}
+
+module ShouldFail where
+
+--!!! unboxed field in newtype declaration
+
+import GlaExts ( Int# )
+
+newtype Unboxed = Unboxed Int#
+
+f = [ Unboxed 1#, Unboxed 2# ] -- shouldn't be allowed!
diff --git a/ghc/tests/typecheck/should_fail/tcfail079.stderr b/ghc/tests/typecheck/should_fail/tcfail079.stderr
new file mode 100644 (file)
index 0000000..c25c1ba
--- /dev/null
@@ -0,0 +1,7 @@
+tcfail079.hs:9:
+    Newtype constructor field has an unboxed type: `Int#'
+    In the newtype declaration for `Unboxed'
+
+
+Compilation had errors