X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Ftypecheck%2FTcUnify.lhs;h=4aa9b3d3c4e721d22374dcf8d77ee0bc452cc6e3;hb=4cf7988f740ee799bbdb0b6e653c096099378085;hp=7ce2fca0654167428c91a0fa01b5c95dcd672693;hpb=467f588c25e6d7825a11eff018a67727b3dea71b;p=ghc-hetmet.git diff --git a/compiler/typecheck/TcUnify.lhs b/compiler/typecheck/TcUnify.lhs index 7ce2fca..4aa9b3d 100644 --- a/compiler/typecheck/TcUnify.lhs +++ b/compiler/typecheck/TcUnify.lhs @@ -904,12 +904,13 @@ tcGen expected_ty extra_tvs thing_inside -- We expect expected_ty to be a forall ; let skol_info = GenSkol forall_tvs (mkPhiTy theta rho_ty) ; return ((forall_tvs, theta, rho_ty), skol_info) }) -#ifdef DEBUG - ; traceTc (text "tcGen" <+> vcat [text "extra_tvs" <+> ppr extra_tvs, - text "expected_ty" <+> ppr expected_ty, - text "inst ty" <+> ppr tvs' <+> ppr theta' <+> ppr rho', - text "free_tvs" <+> ppr free_tvs]) -#endif + ; when debugIsOn $ + traceTc (text "tcGen" <+> vcat [ + text "extra_tvs" <+> ppr extra_tvs, + text "expected_ty" <+> ppr expected_ty, + text "inst ty" <+> ppr tvs' <+> ppr theta' + <+> ppr rho', + text "free_tvs" <+> ppr free_tvs]) -- Type-check the arg and unify with poly type ; (result, lie) <- getLIE (thing_inside tvs' rho') @@ -1487,17 +1488,17 @@ uMetaVar outer swapped tv1 BoxTv ref1 ps_ty2 non_var_ty2 -- -- It should not be the case that tv1 occurs in ty2 -- (i.e. no occurs check should be needed), but if perchance - -- it does, the unbox operation will fill it, and the DEBUG + -- it does, the unbox operation will fill it, and the debug code -- checks for that. - do { final_ty <- unBox ps_ty2 -#ifdef DEBUG - ; meta_details <- readMutVar ref1 - ; case meta_details of - Indirect ty -> WARN( True, ppr tv1 <+> ppr ty ) - return () -- This really should *not* happen - Flexi -> return () -#endif - ; checkUpdateMeta swapped tv1 ref1 final_ty + do { final_ty <- unBox ps_ty2 + ; when debugIsOn $ do + { meta_details <- readMutVar ref1 + ; case meta_details of + Indirect ty -> WARN( True, ppr tv1 <+> ppr ty ) + return () -- This really should *not* happen + Flexi -> return () + } + ; checkUpdateMeta swapped tv1 ref1 final_ty ; return IdCo }