Skip to content
  • Simon Peyton Jones's avatar
    [project @ 2003-12-31 08:23:25 by simonpj] · 7473349e
    Simon Peyton Jones authored
    -----------------------------
            Improve deprecation reporting
    	-----------------------------
    
    	[PS: the 1.31 commit of basicTypes/RdrName.lhs
    	 also belongs in this commit.]
    
    Up to now, deprecated functions are only reported when imported
    from the module defining them, but not when re-exporting.  This
    seems wrong -- often a "root" module gathers exports from sub-modules.
    
    It turned out that there was a structural problem: the deprectaions
    were getting put in the GlobalRdrEnv, and it simply doesn't have
    the defining-module's interface to hand.
    
    So this commit removes gre_deprec from GRE, and moves deprecation
    reporting from the individual occurrences (RnEnv.lookupGreRn) to
    RnNames.reportUnusedNames.  In many ways this is a better place for it,
    because there we get a global view of the entire module.  For example,
    repeated use of a single deprecated thing will only give rise to one
    warning instead of multiple warnings.
    
    So here's what we now get:
    
      Foo.hs:3:0:
        Warning: Deprecated use of Variable `withObject'
    	     (imported from Foreign.Marshal, but defined in Foreign.Marshal.Utils)
    	     use `with' instead
    7473349e