Give the inferred type when warning of a missing type-signature (Trac #1256)
[ghc-hetmet.git] / compiler / rename / RnBinds.lhs
index ecd3b3d..d7a5952 100644 (file)
@@ -178,20 +178,7 @@ rnTopBindsBoot (ValBindsIn mbinds sigs)
        ; return (ValBindsOut [] sigs', usesOnly (hsSigsFVs sigs')) }
 
 rnTopBindsSrc :: HsValBinds RdrName -> RnM (HsValBinds Name, DefUses)
-rnTopBindsSrc binds@(ValBindsIn mbinds _)
-  = do { (binds', dus) <- rnValBinds noTrim binds
-
-               -- Warn about missing signatures, 
-       ; let   { ValBindsOut _ sigs' = binds'
-               ; ty_sig_vars = mkNameSet [ unLoc n | L _ (TypeSig n _) <- sigs']
-               ; un_sigd_bndrs = duDefs dus `minusNameSet` ty_sig_vars }
-
-       ; warn_missing_sigs <- doptM Opt_WarnMissingSigs
-       ; ifM (warn_missing_sigs)
-             (mappM_ missingSigWarn (nameSetToList un_sigd_bndrs))
-
-       ; return (binds', dus)
-       }
+rnTopBindsSrc binds = rnValBinds noTrim binds
 \end{code}
 
 
@@ -398,7 +385,7 @@ rnBind sig_fn trim (L loc (FunBind { fun_id = name, fun_infix = inf, fun_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 = idHsWrapper }), 
+                                  bind_fvs = trim fvs, fun_co_fn = idHsWrapper, fun_tick = Nothing }), 
                  [plain_name], fvs)
       }
 \end{code}
@@ -445,8 +432,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 = idHsWrapper })), 
+    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
@@ -644,12 +634,6 @@ unknownSigErr (L loc sig)
   where
     what_it_is = hsSigDoc sig
 
-missingSigWarn var
-  = addWarnAt (mkSrcSpan loc loc) $
-      sep [ptext SLIT("Definition but no type signature for"), quotes (ppr var)]
-  where 
-    loc = nameSrcLoc var  -- TODO: make a proper span
-
 methodBindErr mbind
  =  hang (ptext SLIT("Pattern bindings (except simple variables) not allowed in instance declarations"))
        2 (ppr mbind)