X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2FcoreSyn%2FCorePrep.lhs;h=e90a12a505e830149a68cf19e04c7e8bc1535a8a;hb=6084fb5517da34f65034370a3695e2af3b85ce2b;hp=4d942611e3966df68b7a6ae02aa56c97156c7679;hpb=b5751b8e46401a9c193756c6ea8adf48df3ca516;p=ghc-hetmet.git diff --git a/compiler/coreSyn/CorePrep.lhs b/compiler/coreSyn/CorePrep.lhs index 4d94261..e90a12a 100644 --- a/compiler/coreSyn/CorePrep.lhs +++ b/compiler/coreSyn/CorePrep.lhs @@ -35,6 +35,7 @@ import DynFlags import Util import Outputable import MonadUtils +import FastString \end{code} -- --------------------------------------------------------------------------- @@ -633,7 +634,7 @@ mkBinds (Floats _ binds) body etaExpandRhs :: CoreBndr -> CoreExpr -> UniqSM CoreExpr etaExpandRhs bndr rhs = do -- Eta expand to match the arity claimed by the binder - -- Remember, after CorePrep we must not change arity + -- Remember, CorePrep must not change arity -- -- Eta expansion might not have happened already, -- because it is done by the simplifier only when @@ -662,7 +663,12 @@ etaExpandRhs bndr rhs = do -- f = /\a -> \y -> let s = h 3 in g s y -- us <- getUniquesM - return (etaExpand arity us rhs (idType bndr)) + let eta_rhs = etaExpand arity us rhs (idType bndr) + + ASSERT2( manifestArity eta_rhs == arity, (ppr bndr <+> ppr arity <+> ppr (exprArity rhs)) + $$ ppr rhs $$ ppr eta_rhs ) + -- Assertion checks that eta expansion was successful + return eta_rhs where -- For a GlobalId, take the Arity from the Id. -- It was set in CoreTidy and must not change @@ -840,5 +846,5 @@ newVar :: Type -> UniqSM Id newVar ty = seqType ty `seq` do uniq <- getUniqueM - return (mkSysLocal FSLIT("sat") uniq ty) + return (mkSysLocal (fsLit "sat") uniq ty) \end{code}