diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2015-07-21 14:34:31 +0100 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2015-07-21 15:57:09 +0100 |
commit | 7a6ed665dc08721cf36a39eb5c35559f7919d185 (patch) | |
tree | 12f00722504245027db68f85d87fd026da4d27af /compiler | |
parent | f1d0480971dff8a410f3ec0ffdecb14cc6050b57 (diff) | |
download | haskell-7a6ed665dc08721cf36a39eb5c35559f7919d185.tar.gz |
Comments only
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/typecheck/TcErrors.hs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/typecheck/TcErrors.hs b/compiler/typecheck/TcErrors.hs index 464db67e2f..9f4cb4d473 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) } |