[project @ 2005-05-24 09:38:29 by simonpj]
authorsimonpj <unknown>
Tue, 24 May 2005 09:38:29 +0000 (09:38 +0000)
committersimonpj <unknown>
Tue, 24 May 2005 09:38:29 +0000 (09:38 +0000)
Yet another wibble to the GHCi top-level interaction story; avoid dup error messages

ghc/compiler/typecheck/TcRnDriver.lhs

index 31d832e..66f3f95 100644 (file)
@@ -962,7 +962,10 @@ mkPlan (L loc (ExprStmt expr _ _)) -- An expression typed at the prompt
                        -- If not, fail; if so, try to print it.
                        -- The two-step process avoids getting two errors: one from
                        -- the expression itself, and one from the 'print it' part
-                   do { tcGhciStmts [let_stmt]; tcGhciStmts [let_stmt, print_it] }
+                       -- This two-step story is very clunky, alas
+                   do { checkNoErrs (tcGhciStmts [let_stmt]) 
+                               --- checkNoErrs defeats the error recovery of let-bindings
+                      ; tcGhciStmts [let_stmt, print_it] }
          ]}
 
 mkPlan stmt@(L loc (BindStmt {}))