summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_fail/T12729.hs
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2016-10-19 12:22:11 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2016-10-19 12:23:54 +0100
commit1f09c16c38a2112322d8eab95cd1269daaf5a818 (patch)
tree6cf15260b84b2a24e515233231337ebafbce89c5 /testsuite/tests/typecheck/should_fail/T12729.hs
parent02f2f21ce4a9969406cf1772dc5955a97386777a (diff)
downloadhaskell-1f09c16c38a2112322d8eab95cd1269daaf5a818.tar.gz
Test for newtype with unboxed argument
Newtypes cannot (currently) have an unboxed argument type. But Trac #12729 showed that this was only being checked for newtypes in H98 syntax; in GADT snytax they were let through. This patch moves the test to checkValidDataCon, where it properly belongs.
Diffstat (limited to 'testsuite/tests/typecheck/should_fail/T12729.hs')
-rw-r--r--testsuite/tests/typecheck/should_fail/T12729.hs11
1 files changed, 11 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_fail/T12729.hs b/testsuite/tests/typecheck/should_fail/T12729.hs
new file mode 100644
index 0000000000..bb70737e93
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/T12729.hs
@@ -0,0 +1,11 @@
+{-# LANGUAGE GADTs, MagicHash #-}
+
+module T12729 where
+
+import GHC.Exts
+
+newtype A where
+ MkA :: Int# -> A
+
+newtype B = MkB Int#
+