GHC recompilation checker doesn't take account of deprecated pragmas
Given the sources:
-- A.hs --------------------
module A
-- {-# DEPRECATED "bad" #-}
where
a = 1
-- B.hs --------------------
module B where
import A
I get the interactions:
$ ghc B
[1 of 2] Compiling A ( A.hs, A.o )
[2 of 2] Compiling B ( B.hs, B.o )
$ manually edit A.hs to uncomment the deprecated line
$ ghc B
[1 of 2] Compiling A ( A.hs, A.o )
$ touch B.hs
$ ghc B
[2 of 2] Compiling B ( B.hs, B.o )
B.hs:2:1: warning: [-Wdeprecations] Module `A' is deprecated: bad
|
2 | import A
| ^^^^^^^^
Observe that after editing the deprecated pragma in A.hs
GHC didn't recompile B.hs
, meaning that the warning only appeared after I touch'd B.hs
. Turning on -Werror
turns the problem from one of incorrectly missing warnings to one of incorrect compilation results.
I was also got the same results when adding a deprecated pragma to an individual function.
My guess is whatever .hi
hash you take for recompilation checking should include deprecated pragmas.
Trac metadata
Trac field | Value |
---|---|
Version | 8.2.1 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | ndmitchell@gmail.com |
Operating system | |
Architecture |