Fall over more gracefully when there's a Template Haskell error
[ghc-hetmet.git] / compiler / deSugar / DsExpr.lhs
index f7b232c..4c2bd3e 100644 (file)
@@ -85,7 +85,9 @@ dsValBinds (ValBindsOut binds _) body = foldrDs ds_val_bind body binds
 -------------------------
 dsIPBinds (IPBinds ip_binds dict_binds) body
   = do { prs <- dsLHsBinds dict_binds
-       ; let inner = foldr (\(x,r) e -> Let (NonRec x r) e) body prs 
+       ; let inner = Let (Rec prs) body
+               -- The dict bindings may not be in 
+               -- dependency order; hence Rec
        ; foldrDs ds_ip_bind inner ip_binds }
   where
     ds_ip_bind (L _ (IPBind n e)) body
@@ -218,7 +220,7 @@ dsExpr (HsApp (L _ (HsApp realFun@(L _ (HsCoerce _ fun)) (L loc arg))) _)
     | HsVar funId <- fun
     , idName funId `elem` [breakpointJumpName, breakpointCondJumpName]
     , ids <- filter (isValidType . idType) (extractIds arg)
-    = do dsWarn (text "Extracted ids:" <+> ppr ids <+> ppr (map idType ids))
+    = do warnDs (text "Extracted ids:" <+> ppr ids <+> ppr (map idType ids))
          stablePtr <- ioToIOEnv $ newStablePtr ids
          -- Yes, I know... I'm gonna burn in hell.
          let Ptr addr# = castStablePtrToPtr stablePtr