[commit: ghc] master: Fix #15423 by using pprAStmtContext (99f45e2)

git at git.haskell.org git at git.haskell.org
Fri Jul 20 12:17:54 UTC 2018


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

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

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

commit 99f45e2a751dda4fdf00256d397a2932d430f3a7
Author: Ryan Scott <ryan.gl.scott at gmail.com>
Date:   Fri Jul 20 12:50:50 2018 +0200

    Fix #15423 by using pprAStmtContext
    
    Summary:
    Previously, we were using `pprStmtContext` instead, which
    led to error messages missing indefinite articles where they were
    required.
    
    Test Plan: make test TEST="T13242a T7786 Typeable1"
    
    Reviewers: bgamari
    
    Subscribers: rwbarton, thomie, carter
    
    GHC Trac Issues: #15423
    
    Differential Revision: https://phabricator.haskell.org/D4992


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

99f45e2a751dda4fdf00256d397a2932d430f3a7
 compiler/hsSyn/HsExpr.hs                               | 2 +-
 testsuite/tests/ado/T13242a.stderr                     | 2 +-
 testsuite/tests/indexed-types/should_fail/T7786.stderr | 2 +-
 testsuite/tests/typecheck/should_run/Typeable1.stderr  | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/compiler/hsSyn/HsExpr.hs b/compiler/hsSyn/HsExpr.hs
index 96d86c8..a5c65fb 100644
--- a/compiler/hsSyn/HsExpr.hs
+++ b/compiler/hsSyn/HsExpr.hs
@@ -2804,7 +2804,7 @@ pprMatchContextNoun PatBindGuards   = text "pattern binding guards"
 pprMatchContextNoun LambdaExpr      = text "lambda abstraction"
 pprMatchContextNoun ProcExpr        = text "arrow abstraction"
 pprMatchContextNoun (StmtCtxt ctxt) = text "pattern binding in"
-                                      $$ pprStmtContext ctxt
+                                      $$ pprAStmtContext ctxt
 pprMatchContextNoun PatSyn          = text "pattern synonym declaration"
 
 -----------------
diff --git a/testsuite/tests/ado/T13242a.stderr b/testsuite/tests/ado/T13242a.stderr
index a8e6495..f31307d 100644
--- a/testsuite/tests/ado/T13242a.stderr
+++ b/testsuite/tests/ado/T13242a.stderr
@@ -4,7 +4,7 @@ T13242a.hs:10:5: error:
       ‘a’ is a rigid type variable bound by
         a pattern with constructor: A :: forall a. Eq a => a -> T,
         in a pattern binding in
-             'do' block
+             a 'do' block
         at T13242a.hs:10:3-5
     • In the expression:
         do A x <- undefined
diff --git a/testsuite/tests/indexed-types/should_fail/T7786.stderr b/testsuite/tests/indexed-types/should_fail/T7786.stderr
index af9ca89..a82a1ca 100644
--- a/testsuite/tests/indexed-types/should_fail/T7786.stderr
+++ b/testsuite/tests/indexed-types/should_fail/T7786.stderr
@@ -30,7 +30,7 @@ T7786.hs:97:31: error:
       from the context: xxx ~ 'Empty
         bound by a pattern with constructor: Nil :: forall a. Sing 'Empty,
                  in a pattern binding in
-                      'do' block
+                      a 'do' block
         at T7786.hs:96:22-24
     • In the second argument of ‘($)’, namely ‘Sub db k sub’
       In a stmt of a 'do' block: return $ Sub db k sub
diff --git a/testsuite/tests/typecheck/should_run/Typeable1.stderr b/testsuite/tests/typecheck/should_run/Typeable1.stderr
index 77d2604..ec16681 100644
--- a/testsuite/tests/typecheck/should_run/Typeable1.stderr
+++ b/testsuite/tests/typecheck/should_run/Typeable1.stderr
@@ -9,7 +9,7 @@ Typeable1.hs:22:5: error: [-Winaccessible-code (in -Wdefault), -Werror=inaccessi
                  (t ~ a b) =>
                  TypeRep a -> TypeRep b -> TypeRep t,
         in a pattern binding in
-             'do' block
+             a 'do' block
     • In the pattern: App x y
       In a stmt of a 'do' block: App x y <- pure x
       In the expression:



More information about the ghc-commits mailing list