[commit: ghc] master: Comments only (7a6ed66)

git at git.haskell.org git at git.haskell.org
Tue Jul 21 16:42:56 UTC 2015


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

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

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

commit 7a6ed665dc08721cf36a39eb5c35559f7919d185
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Tue Jul 21 14:34:31 2015 +0100

    Comments only


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

7a6ed665dc08721cf36a39eb5c35559f7919d185
 compiler/typecheck/TcErrors.hs | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/compiler/typecheck/TcErrors.hs b/compiler/typecheck/TcErrors.hs
index 464db67..9f4cb4d 100644
--- a/compiler/typecheck/TcErrors.hs
+++ b/compiler/typecheck/TcErrors.hs
@@ -694,14 +694,15 @@ mkIrredErr ctxt cts
 ----------------
 mkHoleError :: ReportErrCtxt -> Ct -> TcM ErrMsg
 mkHoleError ctxt ct@(CHoleCan { cc_occ = occ, cc_hole = hole_sort })
-  | isOutOfScopeCt ct
+  | isOutOfScopeCt ct  -- Out of scope variables, like 'a', where 'a' isn't bound
+                       -- Suggest possible in-scope variables in the message
   = do { dflags  <- getDynFlags
        ; rdr_env <- getGlobalRdrEnv
        ; mkLongErrAt (RealSrcSpan (tcl_loc lcl_env)) out_of_scope_msg
                      (unknownNameSuggestions dflags rdr_env
                                (tcl_rdr lcl_env) (mkRdrUnqual occ)) }
 
-  | otherwise
+  | otherwise  -- Explicit holes, like "_" or "_f"
   = do { (ctxt, binds_doc, ct) <- relevantBindings False ctxt ct
                -- The 'False' means "don't filter the bindings"; see Trac #8191
        ; mkErrorMsgFromCt ctxt ct (hole_msg $$ binds_doc) }



More information about the ghc-commits mailing list