Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 5,249
    • Issues 5,249
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 578
    • Merge requests 578
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell CompilerGlasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #9061
Closed
Open
Issue created May 01, 2014 by bergmark@trac-bergmark

Warnings for redundant imports doesn't take name shadowing into account (Regression)

Reproduction:

module Log where

import Prelude hiding (log)

f :: ()
f = log where log = ()

Compiling this with -Wall On GHC 7.8.2:

> ghc Log.hs -Wall
[1 of 1] Compiling Log              ( Log.hs, Log.o )

Log.hs:3:1: Warning:
    The import of ‘Prelude’ is redundant
      except perhaps to import instances from ‘Prelude’
    To import instances alone, use: import Prelude()

The suggestion is incorrect since removing the import statement gives the following warning:

Log.hs:4:15: Warning:
    This binding for ‘log’ shadows the existing binding
      imported from ‘Prelude’ at Log.hs:1:8-10
      (and originally defined in ‘GHC.Float’)

On GHC 7.6.3 the Reproduction does not give any warnings (which is correct).

Trac metadata
Trac field Value
Version 7.8.2
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking