[project @ 2004-11-10 04:17:50 by wolfgang]
[ghc-hetmet.git] / ghc / compiler / specialise / SpecConstr.lhs
index ab7ccd4..c7824ca 100644 (file)
@@ -19,7 +19,7 @@ import WwLib          ( mkWorkerArgs )
 import DataCon         ( dataConRepArity )
 import Type            ( tyConAppArgs )
 import Id              ( Id, idName, idType, 
-                         isDataConId_maybe, 
+                         isDataConWorkId_maybe, 
                          mkUserLocal, mkSysLocal )
 import Var             ( Var )
 import VarEnv
@@ -335,11 +335,13 @@ scExpr env (Note n e) = scExpr env e      `thenUs` \ (usg,e') ->
 scExpr env (Lam b e)  = scExpr (extendBndr env b) e    `thenUs` \ (usg,e') ->
                        returnUs (usg, Lam b e')
 
-scExpr env (Case scrut b alts) 
+-- gaw 2004
+scExpr env (Case scrut b ty alts) 
   = sc_scrut scrut             `thenUs` \ (scrut_usg, scrut') ->
     mapAndUnzipUs sc_alt alts  `thenUs` \ (alts_usgs, alts') ->
+-- gaw 2004
     returnUs (combineUsages alts_usgs `combineUsage` scrut_usg,
-             Case scrut' b alts')
+             Case scrut' b ty alts')
   where
     sc_scrut e@(Var v) = returnUs (varUsage env v CaseScrut, e)
     sc_scrut e        = scExpr env e
@@ -582,7 +584,7 @@ is_con_app_maybe env (Lit lit)
 
 is_con_app_maybe env expr
   = case collectArgs expr of
-       (Var fun, args) | Just con <- isDataConId_maybe fun,
+       (Var fun, args) | Just con <- isDataConWorkId_maybe fun,
                          args `lengthAtLeast` dataConRepArity con
                -- Might be > because the arity excludes type args
                        -> Just (DataAlt con,args)