[project @ 2001-04-14 22:32:14 by qrczak]
[ghc-hetmet.git] / ghc / compiler / rename / RnBinds.lhs
index 7079112..32e37cd 100644 (file)
@@ -32,7 +32,7 @@ import RnEnv          ( bindLocatedLocalsRn, lookupBndrRn,
                        )
 import CmdLineOpts     ( DynFlag(..) )
 import Digraph         ( stronglyConnComp, SCC(..) )
-import Name            ( OccName, Name, nameOccName )
+import Name            ( Name, nameOccName, nameSrcLoc )
 import NameSet
 import RdrName         ( RdrName, rdrNameOcc )
 import BasicTypes      ( RecFlag(..) )
@@ -69,8 +69,6 @@ within one @MonoBinds@, so that unique-Int plumbing is done explicitly
 
 \begin{code}
 type VertexTag = Int
-type Cycle     = [VertexTag]
-type Edge      = (VertexTag, VertexTag)
 \end{code}
 
 %************************************************************************
@@ -176,7 +174,7 @@ rnTopMonoBinds mbinds sigs
                                                           bndr_name_set type_sig_vars)
                        | otherwise   = []
     in
-    mapRn_ (addWarnRn.missingSigWarn) un_sigd_binders  `thenRn_`
+    mapRn_ missingSigWarn un_sigd_binders      `thenRn_`
 
     rn_mono_binds siglist mbinds                  `thenRn` \ (final_binds, bind_fvs) ->
     returnRn (final_binds, bind_fvs `plusFV` sig_fvs)
@@ -239,7 +237,7 @@ rnMonoBinds mbinds sigs     thing_inside -- Non-empty monobinds
     rn_mono_binds siglist mbinds          `thenRn` \ (binds, bind_fvs) ->
 
     -- Now do the "thing inside", and deal with the free-variable calculations
-    thing_inside binds                    `thenRn` \ (result,result_fvs) ->
+    thing_inside binds                            `thenRn` \ (result,result_fvs) ->
     let
        all_fvs        = result_fvs `plusFV` bind_fvs `plusFV` sig_fvs
        unused_binders = nameSetToList (binder_set `minusNameSet` all_fvs)
@@ -265,8 +263,8 @@ This is done {\em either} by pass 3 (for the top-level bindings),
 \begin{code}
 rn_mono_binds :: [RenamedSig]          -- Signatures attached to this group
              -> RdrNameMonoBinds       
-             -> RnMS (RenamedHsBinds,  -- 
-                        FreeVars)      -- Free variables
+             -> RnMS (RenamedHsBinds,  -- Dependency analysed
+                      FreeVars)        -- Free variables
 
 rn_mono_binds siglist mbinds
   =
@@ -387,7 +385,7 @@ rnMethodBinds gen_tyvars (FunMonoBind name inf matches locn)
     returnRn (FunMonoBind sel_name inf new_matches locn, fvs `addOneFV` sel_name)
   where
        -- Gruesome; bring into scope the correct members of the generic type variables
-       -- See comments in RnSource.rnDecl(ClassDecl)
+       -- See comments in RnSource.rnSourceDecl(ClassDecl)
     rn_match match@(Match _ (TypePatIn ty : _) _ _)
        = extendTyVarEnvFVRn gen_tvs (rnMatch match)
        where
@@ -526,6 +524,9 @@ renameSig (SpecInstSig ty src_loc)
     rnHsType (text "A SPECIALISE instance pragma") ty `thenRn` \ new_ty ->
     returnRn (SpecInstSig new_ty src_loc)
 
+renameSig (InlineInstSig p src_loc)
+  = returnRn (InlineInstSig p src_loc)
+
 renameSig (SpecSig v ty src_loc)
   = pushSrcLocRn src_loc $
     lookupSigOccRn v                   `thenRn` \ new_v ->
@@ -594,7 +595,8 @@ unknownSigErr sig
     (what_it_is, loc) = hsSigDoc sig
 
 missingSigWarn var
-  = sep [ptext SLIT("definition but no type signature for"), quotes (ppr var)]
+  = pushSrcLocRn (nameSrcLoc var) $
+    addWarnRn (sep [ptext SLIT("Definition but no type signature for"), quotes (ppr var)])
 
 methodBindErr mbind
  =  hang (ptext SLIT("Can't handle multiple methods defined by one pattern binding"))