[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 16:59:45 UTC 2023



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


Commits:
711b1d24 by Bartłomiej Cieślar at 2023-06-21T12:59:27-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>

- - - - -
c1865854 by Ben Gamari at 2023-06-21T12:59:30-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/9796d612ed44296f2c6752830923938c20b70a36...c18658545ce45254a4679c13de5dcc56a4c8373f

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/9796d612ed44296f2c6752830923938c20b70a36...c18658545ce45254a4679c13de5dcc56a4c8373f
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/c6cfddd8/attachment.html>


More information about the ghc-commits mailing list