explicitly importing deprecated symbols should elicit the deprecation warning
If we explicitly import but do not use a deprecated function then ghc does not give the deprecation warning.
module Foo where
{-# DEPRECATED foo "don't use foo please, use ..." #-}
foo = ...
module Bar where
import Foo (foo)
This is a bit annoying since it means client packages do not get any notification that some function is going to disappear but they would break if it does disappear. Or to look at it another way, it prevents me removing old deprecated functions because I don't want to break client programs but I have no way of communicating that to the author of a program that is importing but is no longer using the deprecated function.
My real world example is the Cabal lib and lhs2tex's Setup.hs file. It is importing Distribution.Simple.LocalBuildInfo.mkDataDir
(which is deprecated in the current released Cabal version) but the Setup.hs is not actually using it, so the author got no indication that it should not be imported anymore. In the development version of Cabal I'd already removed this deprecated function since I assumed we'd given everyone plenty of warning. I'll have to go add mkDataDir
back.
Trac metadata
Trac field | Value |
---|---|
Version | 6.8.2 |
Type | FeatureRequest |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | Unknown |
Architecture | Unknown |