[commit: ghc] master: Fix #9824 by not warning about unused matches in pattern quotes. (bc05354)

git at git.haskell.org git at git.haskell.org
Fri Nov 21 16:18:39 UTC 2014


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/bc05354949dce9d3b56353d3310eb9804d4e17f5/ghc

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

commit bc05354949dce9d3b56353d3310eb9804d4e17f5
Author: Richard Eisenberg <eir at cis.upenn.edu>
Date:   Fri Nov 21 10:33:37 2014 -0500

    Fix #9824 by not warning about unused matches in pattern quotes.


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

bc05354949dce9d3b56353d3310eb9804d4e17f5
 compiler/rename/RnPat.lhs | 3 +++
 testsuite/tests/th/all.T  | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/compiler/rename/RnPat.lhs b/compiler/rename/RnPat.lhs
index 370f6b4..d80b05e 100644
--- a/compiler/rename/RnPat.lhs
+++ b/compiler/rename/RnPat.lhs
@@ -203,6 +203,9 @@ matchNameMaker ctxt = LamMk report_unused
     -- i.e. when you type 'x <- e' at the GHCi prompt
     report_unused = case ctxt of
                       StmtCtxt GhciStmtCtxt -> False
+                      -- also, don't warn in pattern quotes, as there
+                      -- is no RHS where the variables can be used!
+                      ThPatQuote            -> False
                       _                     -> True
 
 rnHsSigCps :: HsWithBndrs RdrName (LHsType RdrName)
diff --git a/testsuite/tests/th/all.T b/testsuite/tests/th/all.T
index e8b8cb6..60b6089 100644
--- a/testsuite/tests/th/all.T
+++ b/testsuite/tests/th/all.T
@@ -346,4 +346,4 @@ test('T9209', normal, compile_fail, ['-v0'])
 test('T7484', normal, compile_fail, ['-v0'])
 test('T1476', normal, compile, ['-v0'])
 test('T1476b', normal, compile_fail, ['-v0'])
-test('T9824', expect_broken(9824), compile, ['-v0'])
+test('T9824', normal, compile, ['-v0'])



More information about the ghc-commits mailing list