summaryrefslogtreecommitdiff
path: root/testsuite/tests/rename
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2014-11-21 13:02:45 +0000
committerSimon Peyton Jones <simonpj@microsoft.com>2014-11-21 13:02:45 +0000
commit4ba4cc7aaaf2bff31bc8474c8ba40e1cbe3e3875 (patch)
tree7460b9a9c6e2f9a64bd3b96137646ccaec63209b /testsuite/tests/rename
parenteaccc72162194d12a33aa454b57c126bcabcdd5d (diff)
downloadhaskell-4ba4cc7aaaf2bff31bc8474c8ba40e1cbe3e3875.tar.gz
Fix Trac #9815
Dot-dot record-wildcard notation is simply illegal for constructors without any named fields, but that was neither documented nor checked. This patch does so - Make the check in RnPat - Add test T9815 - Fix CmmLayoutStack which was using the illegal form (!) - Document in user manual
Diffstat (limited to 'testsuite/tests/rename')
-rw-r--r--testsuite/tests/rename/should_fail/T9815.hs6
-rw-r--r--testsuite/tests/rename/should_fail/T9815.stderr4
-rw-r--r--testsuite/tests/rename/should_fail/all.T1
3 files changed, 11 insertions, 0 deletions
diff --git a/testsuite/tests/rename/should_fail/T9815.hs b/testsuite/tests/rename/should_fail/T9815.hs
new file mode 100644
index 0000000000..7d7ae6616e
--- /dev/null
+++ b/testsuite/tests/rename/should_fail/T9815.hs
@@ -0,0 +1,6 @@
+{-# LANGUAGE RecordWildCards #-}
+module T9815 where
+
+newtype N = N Int deriving (Show)
+
+foo = print N{..}
diff --git a/testsuite/tests/rename/should_fail/T9815.stderr b/testsuite/tests/rename/should_fail/T9815.stderr
new file mode 100644
index 0000000000..99f16b624d
--- /dev/null
+++ b/testsuite/tests/rename/should_fail/T9815.stderr
@@ -0,0 +1,4 @@
+
+T9815.hs:6:13:
+ Illegal `..' notation for constructor ā€˜Nā€™
+ The constructor has no labelled fields
diff --git a/testsuite/tests/rename/should_fail/all.T b/testsuite/tests/rename/should_fail/all.T
index f2664dc2bf..56d0f87fb9 100644
--- a/testsuite/tests/rename/should_fail/all.T
+++ b/testsuite/tests/rename/should_fail/all.T
@@ -119,3 +119,4 @@ test('T9177', normal, compile_fail, [''])
test('T9436', normal, compile_fail, [''])
test('T9437', normal, compile_fail, [''])
test('T9077', normal, compile_fail, [''])
+test('T9815', normal, compile_fail, [''])