Fixed uninitialised FunBind fun_tick field
[ghc-hetmet.git] / compiler / rename / RnBinds.lhs
index 713fe00..a96c63f 100644 (file)
@@ -379,8 +379,8 @@ rnBind sig_fn trim (L loc (PatBind { pat_lhs = pat, pat_rhs = grhss }))
 
        ; let bndrs = collectPatBinders pat'
 
-       ; (grhss', fvs) <- bindSigTyVarsFV (concatMap sig_fn bndrs) $
-                          rnGRHSs PatBindRhs grhss
+       ; (grhss', fvs) <- rnGRHSs PatBindRhs grhss
+               -- No scoped type variables for pattern bindings
 
        ; return (L loc (PatBind { pat_lhs = pat', pat_rhs = grhss', 
                                   pat_rhs_ty = placeHolderType, bind_fvs = trim fvs }), 
@@ -392,12 +392,13 @@ rnBind sig_fn trim (L loc (FunBind { fun_id = name, fun_infix = inf, fun_matches
        ; let plain_name = unLoc new_name
 
        ; (matches', fvs) <- bindSigTyVarsFV (sig_fn plain_name) $
+                               -- bindSigTyVars tests for Opt_ScopedTyVars
                             rnMatchGroup (FunRhs plain_name) matches
 
        ; checkPrecMatch inf plain_name matches'
 
        ; return (L loc (FunBind { fun_id = new_name, fun_infix = inf, fun_matches = matches',
-                                  bind_fvs = trim fvs, fun_co_fn = idCoercion }), 
+                                  bind_fvs = trim fvs, fun_co_fn = idHsWrapper, fun_tick = Nothing }), 
                  [plain_name], fvs)
       }
 \end{code}
@@ -444,8 +445,11 @@ rnMethodBind cls sig_fn gen_tyvars (L loc (FunBind { fun_id = name, fun_infix =
        new_group = MatchGroup new_matches placeHolderType
     in
     checkPrecMatch inf plain_name new_group            `thenM_`
-    returnM (unitBag (L loc (FunBind { fun_id = sel_name, fun_infix = inf, fun_matches = new_group,
-                                      bind_fvs = fvs, fun_co_fn = idCoercion })), 
+    returnM (unitBag (L loc (FunBind { 
+                               fun_id = sel_name, fun_infix = inf, 
+                               fun_matches = new_group,
+                               bind_fvs = fvs, fun_co_fn = idHsWrapper,
+                               fun_tick = Nothing })), 
             fvs `addOneFV` plain_name)
        -- The 'fvs' field isn't used for method binds
   where