Duplicate warning declarations [GHC-00711]

A Haskell entity, such as a type or a top-level definition, can be declared to be deprecated using a pragma. It is, however, illegal to specify multiple deprecation warnings for the same entity.

Examples

Two deprecation warnings for same constant

In this example, two deprecation warnings have been given for the constant pi. This is not allowed, and can be fixed by just specifying one deprecation message.

messages/GHC-00711/doubleDeprecation/before/DoubleDeprecation.hs:4:16: error: [GHC-00711]
    Multiple warning declarations for ‘pi’
    also at  messages/GHC-00711/doubleDeprecation/before/DoubleDeprecation.hs:3:16-17
  |
4 | {-# DEPRECATED pi "Chosen approximation turned out to be too imprecise." #-}
  |                ^^
DoubleDeprecation.hs
Before
module DoubleDeprecation where

{-# DEPRECATED pi "pi is deprecated." #-}
{-# DEPRECATED pi "Chosen approximation turned out to be too imprecise." #-}
pi :: Int
pi = 3
After
module DoubleDeprecation where

{-# DEPRECATED pi "pi is deprecated. Chosen approximation turned out to be too imprecise." #-}
pi :: Int
pi = 3