summaryrefslogtreecommitdiff
path: root/testsuite/tests/overloadedrecflds
diff options
context:
space:
mode:
authorAdam Gundry <adam@well-typed.com>2016-10-01 17:56:58 -0400
committerBen Gamari <ben@smart-cactus.org>2016-10-01 20:01:29 -0400
commit48ff0843eee29313cc2da14c04dc57f6589ab040 (patch)
tree5e88ad5961cabecab891794910bbf3b0570c5718 /testsuite/tests/overloadedrecflds
parentce3370e06165690e79a8eb22e5229b515157e00f (diff)
downloadhaskell-48ff0843eee29313cc2da14c04dc57f6589ab040.tar.gz
Do not warn about unused underscore-prefixed fields (fixes Trac #12609)
When DuplicateRecordFields is enabled, the mangling of selector names was causing them to be reported as unused even if prefixed by an underscore. This corrects the OccName used by the check. Test Plan: New test overloadedrecflds/should_compile/T12609 Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2549 GHC Trac Issues: #12609
Diffstat (limited to 'testsuite/tests/overloadedrecflds')
-rw-r--r--testsuite/tests/overloadedrecflds/should_compile/T12609.hs8
-rw-r--r--testsuite/tests/overloadedrecflds/should_compile/all.T1
2 files changed, 9 insertions, 0 deletions
diff --git a/testsuite/tests/overloadedrecflds/should_compile/T12609.hs b/testsuite/tests/overloadedrecflds/should_compile/T12609.hs
new file mode 100644
index 0000000000..7b8205bc48
--- /dev/null
+++ b/testsuite/tests/overloadedrecflds/should_compile/T12609.hs
@@ -0,0 +1,8 @@
+{-# LANGUAGE DuplicateRecordFields #-}
+{-# OPTIONS_GHC -Werror -Wunused-top-binds #-}
+module Main (main, T(MkT)) where
+
+data T = MkT { _x :: Int }
+
+main :: IO ()
+main = return ()
diff --git a/testsuite/tests/overloadedrecflds/should_compile/all.T b/testsuite/tests/overloadedrecflds/should_compile/all.T
index ea5baf899e..264fa115e4 100644
--- a/testsuite/tests/overloadedrecflds/should_compile/all.T
+++ b/testsuite/tests/overloadedrecflds/should_compile/all.T
@@ -1 +1,2 @@
test('T11173', extra_clean(['T11173a.hi', 'T11173a.o']), multimod_compile, ['T11173', '-v0'])
+test('T12609', normal, compile, [''])