[commit: ghc] master: Don't run a splice if there are preceding type errors (0cda060)

Simon Peyton Jones simonpj at microsoft.com
Tue Aug 2 23:06:03 CEST 2011


Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/0cda0606f53bc6141ac90b00ef814e66795e7da6

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

commit 0cda0606f53bc6141ac90b00ef814e66795e7da6
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Mon Aug 1 15:23:02 2011 +0100

    Don't run a splice if there are preceding type errors
    
    Fixes Trac #5358.

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

 compiler/typecheck/TcSplice.lhs |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/compiler/typecheck/TcSplice.lhs b/compiler/typecheck/TcSplice.lhs
index 3bf26a6..c9df83f 100644
--- a/compiler/typecheck/TcSplice.lhs
+++ b/compiler/typecheck/TcSplice.lhs
@@ -813,6 +813,16 @@ runMeta show_code run_and_convert expr
         ; recordThSpliceUse -- seems to be the best place to do this,
                             -- we catch all kinds of splices and annotations.
 
+	-- Check that we've had no errors of any sort so far.
+	-- For example, if we found an error in an earlier defn f, but
+	-- recovered giving it type f :: forall a.a, it'd be very dodgy
+	-- to carry ont.  Mind you, the staging restrictions mean we won't
+	-- *run* f, but it still seems wrong. And, more concretely, 
+	-- see Trac #5358 for an example that fell over when trying to
+	-- reify a function with a "?" kind in it.  (These don't occur
+	-- in type-correct programs.
+	; failIfErrsM    
+
 	-- Desugar
 	; ds_expr <- initDsTc (dsLExpr expr)
 	-- Compile and link it; might fail if linking fails





More information about the Cvs-ghc mailing list