Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
GHC
GHC
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,326
    • Issues 4,326
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 390
    • Merge Requests 390
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Security & Compliance
    • Security & Compliance
    • Dependency List
    • License Compliance
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #14522

Closed
Open
Opened Nov 24, 2017 by Neil Mitchell@ndmitchellReporter

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
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#14522