Cosmetics in SpecConstr
authorsimonpj@microsoft.com <unknown>
Wed, 12 Apr 2006 15:27:21 +0000 (15:27 +0000)
committersimonpj@microsoft.com <unknown>
Wed, 12 Apr 2006 15:27:21 +0000 (15:27 +0000)
SpecConstr currently uses substExpr for tiresome reasons to do with
GADTs.  Unfortunately the substExpr generates some WARNINGS (when DEBUG)
is on, because we aren't adding all the in-scope Ids to the in-scope
set of the substitution.

When we move to FC these substExprs will go away, so I'm not going to
worry about this now.

compiler/specialise/SpecConstr.lhs

index 74944da..7541a93 100644 (file)
@@ -262,6 +262,9 @@ extendCaseBndrs env case_bndr scrut con@(DataAlt data_con) alt_bndrs
                   map varToCoreExpr alt_bndrs
 
     gadt_args = map (substExpr subst . varToCoreExpr) alt_bndrs
+       -- This call generates some bogus warnings from substExpr,
+       -- because it's inconvenient to put all the Ids in scope
+       -- Will be fixed when we move to FC
 
     (alt_tvs, _) = span isTyVar alt_bndrs
     Just (tv_subst, is_local) = coreRefineTys data_con alt_tvs (idType case_bndr)
@@ -463,7 +466,7 @@ specialise env fn bndrs body (SCU {calls=calls, occs=occs})
        good_calls = [ pats
                     | (con_env, call_args) <- all_calls,
                       call_args `lengthAtLeast` n_bndrs,           -- App is saturated
-                      let call = (bndrs `zip` call_args),
+                      let call = bndrs `zip` call_args,
                       any (good_arg con_env occs) call,    -- At least one arg is a constr app
                       let (_, pats) = argsToPats con_env us call_args
                     ]