[project @ 2000-11-21 16:33:18 by simonmar]
authorsimonmar <unknown>
Tue, 21 Nov 2000 16:34:57 +0000 (16:34 +0000)
committersimonmar <unknown>
Tue, 21 Nov 2000 16:34:57 +0000 (16:34 +0000)
Zonk the expr we return from typecheckExpr.

ghc/compiler/typecheck/TcHsSyn.lhs
ghc/compiler/typecheck/TcModule.lhs

index db82b24..9d2c3ee 100644 (file)
@@ -28,7 +28,7 @@ module TcHsSyn (
        -- re-exported from TcEnv
        TcId, tcInstId,
 
-       zonkTopBinds, zonkId, zonkIdOcc,
+       zonkTopBinds, zonkId, zonkIdOcc, zonkExpr,
        zonkForeignExports, zonkRules
   ) where
 
index 170beaa..9a747c1 100644 (file)
@@ -18,7 +18,8 @@ import HsTypes                ( toHsType )
 import RnHsSyn         ( RenamedHsBinds, RenamedHsDecl, RenamedHsExpr )
 import TcHsSyn         ( TypecheckedMonoBinds, TypecheckedHsExpr,
                          TypecheckedForeignDecl, TypecheckedRuleDecl,
-                         zonkTopBinds, zonkForeignExports, zonkRules, mkHsLet
+                         zonkTopBinds, zonkForeignExports, zonkRules, mkHsLet,
+                         zonkExpr
                        )
 
 
@@ -121,8 +122,10 @@ typecheckExpr dflags pcs hst unqual this_mod (expr, decls)
     newTyVarTy openTypeKind    `thenTc` \ ty ->
     tcMonoExpr expr ty         `thenTc` \ (expr', lie) ->
     tcSimplifyTop lie          `thenTc` \ binds ->
+    let all_expr = mkHsLet binds expr' in
+    zonkExpr all_expr          `thenNF_Tc` \ zonked_expr ->
     zonkTcType ty              `thenNF_Tc` \ zonked_ty ->
-    returnTc (new_pcs, mkHsLet binds expr', zonked_ty) 
+    returnTc (new_pcs, zonked_expr, zonked_ty) 
   where
     get_fixity :: Name -> Maybe Fixity
     get_fixity n = pprPanic "typecheckExpr" (ppr n)