[project @ 2002-09-27 17:12:23 by erkok]
authorerkok <unknown>
Fri, 27 Sep 2002 17:12:23 +0000 (17:12 +0000)
committererkok <unknown>
Fri, 27 Sep 2002 17:12:23 +0000 (17:12 +0000)
make sure we get the name right when we call doStmtListErr

ghc/compiler/rename/RnExpr.lhs

index 299bb31..66ec772 100644 (file)
@@ -286,7 +286,7 @@ rnExpr e@(HsDo do_or_lc stmts _ _ src_loc)
        -- Check the statement list ends in an expression
     case last stmts' of {
        ResultStmt _ _ -> returnM () ;
-       _              -> addErr (doStmtListErr "do" e)
+       _              -> addErr (doStmtListErr (binder_name do_or_lc)  e)
     }                                  `thenM_`
 
        -- Generate the rebindable syntax for the monad
@@ -305,6 +305,9 @@ rnExpr e@(HsDo do_or_lc stmts _ _ src_loc)
     syntax_names MDoExpr = monadNames ++ [mfixName]
     syntax_names other   = []
 
+    binder_name MDoExpr  = "mdo"
+    binder_name other    = "do"
+
 rnExpr (ExplicitList _ exps)
   = rnExprs exps                       `thenM` \ (exps', fvs) ->
     returnM  (ExplicitList placeHolderType exps', fvs `addOneFV` listTyCon_name)