Skip to content

Commit 7e2013c

Browse files
authored
Merge pull request #434 from haskellfoundation/ghc-00711
Document GHC-00711
2 parents fff62b8 + 4d04b29 commit 7e2013c

File tree

4 files changed

+34
-0
lines changed

4 files changed

+34
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module DoubleDeprecation where
2+
3+
{-# DEPRECATED pi "pi is deprecated. Chosen approximation turned out to be too imprecise." #-}
4+
pi :: Int
5+
pi = 3
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module DoubleDeprecation where
2+
3+
{-# DEPRECATED pi "pi is deprecated." #-}
4+
{-# DEPRECATED pi "Chosen approximation turned out to be too imprecise." #-}
5+
pi :: Int
6+
pi = 3
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
title: Two deprecation warnings for same constant
3+
---
4+
5+
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.
6+
7+
```
8+
messages/GHC-00711/doubleDeprecation/before/DoubleDeprecation.hs:4:16: error: [GHC-00711]
9+
Multiple warning declarations for ‘pi’
10+
also at messages/GHC-00711/doubleDeprecation/before/DoubleDeprecation.hs:3:16-17
11+
|
12+
4 | {-# DEPRECATED pi "Chosen approximation turned out to be too imprecise." #-}
13+
| ^^
14+
```
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
title: Duplicate warning declarations
3+
summary: Duplicate deprecation warnings are illegal
4+
severity: error
5+
introduced: 9.6.1
6+
---
7+
8+
A Haskell entity, such as a type or a top-level definition, can be declared to be deprecated using a pragma.
9+
It is, however, illegal to specify multiple deprecation warnings for the same entity.

0 commit comments

Comments
 (0)