[commit: ghc] wip/orf-reboot: Add a test that deprecation warnings cannot be attached to DRFs (dc084f7)

git at git.haskell.org git at git.haskell.org
Mon Oct 12 06:37:41 UTC 2015


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/orf-reboot
Link       : http://ghc.haskell.org/trac/ghc/changeset/dc084f73b45615e164870954674a83c9426a70b2/ghc

>---------------------------------------------------------------

commit dc084f73b45615e164870954674a83c9426a70b2
Author: Adam Gundry <adam at well-typed.com>
Date:   Thu Oct 8 00:41:55 2015 +0100

    Add a test that deprecation warnings cannot be attached to DRFs


>---------------------------------------------------------------

dc084f73b45615e164870954674a83c9426a70b2
 testsuite/tests/overloadedrecflds/should_fail/all.T                  | 1 +
 .../tests/overloadedrecflds/should_fail/overloadedrecfldsfail11.hs   | 5 +++++
 .../overloadedrecflds/should_fail/overloadedrecfldsfail11.stderr     | 4 ++++
 3 files changed, 10 insertions(+)

diff --git a/testsuite/tests/overloadedrecflds/should_fail/all.T b/testsuite/tests/overloadedrecflds/should_fail/all.T
index 7bce887..db689e5 100644
--- a/testsuite/tests/overloadedrecflds/should_fail/all.T
+++ b/testsuite/tests/overloadedrecflds/should_fail/all.T
@@ -16,3 +16,4 @@ test('overloadedrecfldsfail10',
                  , 'OverloadedRecFldsFail10_B.hi', 'OverloadedRecFldsFail10_B.o'
                  , 'OverloadedRecFldsFail10_C.hi', 'OverloadedRecFldsFail10_C.o']),
      multimod_compile_fail, ['overloadedrecfldsfail10', ''])
+test('overloadedrecfldsfail11', normal, compile_fail, [''])
diff --git a/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail11.hs b/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail11.hs
new file mode 100644
index 0000000..9c5c145
--- /dev/null
+++ b/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail11.hs
@@ -0,0 +1,5 @@
+{-# LANGUAGE DuplicateRecordFields #-}
+
+{-# WARNING foo "No warnings for DRFs" #-}
+data S = MkS { foo :: Bool }
+data T = MkT { foo :: Int }
diff --git a/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail11.stderr b/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail11.stderr
new file mode 100644
index 0000000..650456c
--- /dev/null
+++ b/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail11.stderr
@@ -0,0 +1,4 @@
+
+overloadedrecfldsfail11.hs:3:13: error:
+    The deprecation for ‘foo’ lacks an accompanying binding
+      (The deprecation must be given where ‘foo’ is declared)



More information about the ghc-commits mailing list