Opened 10 years ago

Last modified 23 months ago

#2119 new feature request

explicitly importing deprecated symbols should elicit the deprecation warning

Reported by: duncan Owned by:
Priority: lowest Milestone:
Component: Compiler Version: 6.8.2
Keywords: deprecate warning Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Incorrect warning at compile-time Test Case:
Blocked By: Blocking:
Related Tickets: #4879 Differential Rev(s):
Wiki Page:

Description

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.

Change History (19)

comment:1 Changed 10 years ago by igloo

difficulty: Unknown
Milestone: 6.10 branch

Unfortunately, putting this into 6.8.3 could break programs compiled with -Werror, so let's fix it in 6.10.

comment:2 Changed 9 years ago by simonmar

Architecture: UnknownUnknown/Multiple

comment:3 Changed 9 years ago by simonmar

Operating System: UnknownUnknown/Multiple

comment:4 Changed 9 years ago by igloo

Milestone: 6.10 branch6.12 branch

comment:5 Changed 8 years ago by igloo

Milestone: 6.12 branch6.12.3

comment:6 Changed 7 years ago by igloo

Milestone: 6.12.36.14.1
Priority: normallow

comment:7 Changed 7 years ago by igloo

Milestone: 7.0.17.0.2

comment:8 Changed 7 years ago by igloo

Milestone: 7.0.27.2.1

comment:9 Changed 6 years ago by igloo

Milestone: 7.2.17.4.1

comment:10 Changed 6 years ago by igloo

Milestone: 7.4.17.6.1
Priority: lowlowest

comment:11 Changed 5 years ago by igloo

Milestone: 7.6.17.6.2

comment:12 Changed 3 years ago by thoughtpolice

Milestone: 7.6.27.10.1

Moving to 7.10.1.

comment:13 Changed 3 years ago by thoughtpolice

Milestone: 7.10.17.12.1

Moving to 7.12.1 milestone; if you feel this is an error and should be addressed sooner, please move it back to the 7.10.1 milestone.

comment:14 Changed 3 years ago by thoughtpolice

Moving to 7.12.1 milestone; if you feel this is an error and should be addressed sooner, please move it back to the 7.10.1 milestone.

comment:15 Changed 2 years ago by hvr

Keywords: deprecate warning added
Type of failure: None/Unknown

comment:16 Changed 2 years ago by thoughtpolice

Milestone: 7.12.18.0.1

Milestone renamed

comment:17 Changed 2 years ago by bgamari

See Design/DeprecationMechanisms for a summary of this and related deprecation proposals.

comment:18 Changed 23 months ago by thomie

Type of failure: None/UnknownIncorrect warning at compile-time

comment:19 Changed 23 months ago by thomie

Milestone: 8.0.1
Note: See TracTickets for help on using tickets.