[Git][ghc/ghc][wip/ghc-9.8] 2 commits: Add support for deprecating exported items (proposal #134)

Ben Gamari (@bgamari) gitlab at gitlab.haskell.org
Wed Jun 21 12:47:23 UTC 2023



Ben Gamari pushed to branch wip/ghc-9.8 at Glasgow Haskell Compiler / GHC


Commits:
cef9b9a6 by Ben Gamari at 2023-06-20T15:58:35-04:00
Add support for deprecating exported items (proposal #134)

This is an implementation of the deprecated exports proposal #134.
The proposal introduces an ability to introduce warnings to exports.
This allows for deprecating a name only when it is exported from a specific
module, rather than always depreacting its usage. In this example:

    module A ({-# DEPRECATED "do not use" #-} x) where
    x = undefined
    ---
    module B where
    import A(x)

`x` will emit a warning when it is explicitly imported.

Like the declaration warnings, export warnings are first accumulated within
the `Warnings` struct, then passed into the ModIface, from which they are
then looked up and warned about in the importing module in the `lookup_ie`
helpers of the `filterImports` function (for the explicitly imported names)
and in the `addUsedGRE(s)` functions where they warn about regular usages
of the imported name.

In terms of the AST information, the custom warning is stored in the
extension field of the variants of the `IE` type (see Trees that Grow for
more information).

The commit includes a bump to the haddock submodule added in MR #28

Signed-off-by: Bartłomiej Cieślar <bcieslar2001 at gmail.com>

- - - - -
128b0d5c by Ben Gamari at 2023-06-21T08:43:55-04:00
configure: Bump version to 9.8

Bumps Haddock submodule

- - - - -


30 changed files:

- compiler/GHC.hs
- compiler/GHC/Driver/Flags.hs
- compiler/GHC/Driver/Session.hs
- compiler/GHC/Hs/ImpExp.hs
- compiler/GHC/Iface/Make.hs
- compiler/GHC/Iface/Recomp.hs
- compiler/GHC/Iface/Syntax.hs
- compiler/GHC/Parser.y
- compiler/GHC/Parser/PostProcess.hs
- compiler/GHC/Rename/Env.hs
- compiler/GHC/Rename/Module.hs
- compiler/GHC/Rename/Names.hs
- compiler/GHC/Rename/Pat.hs
- compiler/GHC/Runtime/Loader.hs
- compiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Errors/Types.hs
- compiler/GHC/Tc/Gen/Export.hs
- compiler/GHC/Tc/Gen/Expr.hs
- compiler/GHC/Tc/Instance/Class.hs
- compiler/GHC/Tc/Module.hs
- compiler/GHC/Tc/Solver/Monad.hs
- compiler/GHC/Tc/Utils/Backpack.hs
- compiler/GHC/Tc/Utils/Monad.hs
- compiler/GHC/Types/Error/Codes.hs
- compiler/GHC/Types/Hint/Ppr.hs
- compiler/GHC/Types/Name/Env.hs
- compiler/GHC/Types/Name/Reader.hs
- compiler/GHC/Unit/Module/ModIface.hs
- compiler/GHC/Unit/Module/Warnings.hs
- configure.ac


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/e3388370fa196e9637aa92160923713cbb007d91...128b0d5c8a8711e5326c28d69375456e09a23ade

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/e3388370fa196e9637aa92160923713cbb007d91...128b0d5c8a8711e5326c28d69375456e09a23ade
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20230621/6d640164/attachment.html>


More information about the ghc-commits mailing list