Don't try to float type-lets
authorsimonpj@microsoft.com <unknown>
Sun, 14 Sep 2008 11:33:24 +0000 (11:33 +0000)
committersimonpj@microsoft.com <unknown>
Sun, 14 Sep 2008 11:33:24 +0000 (11:33 +0000)
A type let shouldn't really occur in SetLevels, but if it does,
this patch makes sure it is left alone.

compiler/simplCore/SetLevels.lhs

index f5a5a26..4411d74 100644 (file)
@@ -481,7 +481,9 @@ lvlBind :: TopLevelFlag             -- Used solely to decide whether to clone
        -> LvlM (LevelledBind, LevelEnv)
 
 lvlBind top_lvl ctxt_lvl env (AnnNonRec bndr rhs@(rhs_fvs,_))
-  | isInlineCtxt ctxt_lvl              -- Don't do anything inside InlineMe
+  |  isTyVar bndr              -- Don't do anything for TyVar binders
+                               --   (simplifier gets rid of them pronto)
+  || isInlineCtxt ctxt_lvl     -- Don't do anything inside InlineMe
   = do rhs' <- lvlExpr ctxt_lvl env rhs
        return (NonRec (TB bndr ctxt_lvl) rhs', env)