Skip to content

GitLab

  • Menu
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 4,979
    • Issues 4,979
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 470
    • Merge requests 470
  • 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 Compiler
  • GHCGHC
  • Issues
  • #388
Closed
Open
Created May 20, 2005 by nobody@trac-nobody

Incorrect "Defined but not used"

This is johndetr@microsoft.com.

When I compile the following function:

150 hexArg :: P Hex
151 hexArg = do MyState i n <- getState
152             let i = i + 1
153             setState (MyState i n)
154             x <- hexNumber
155             if i < n then do { char ','; return () }
156                       else do { char ')'; eof }
157             return x

I get the following messages:

Vesta.hs:151:20: Warning: Defined but not used: `i'

Vesta.hs:152:16:
    Warning: This binding for `i' shadows an existing 
binding
             In the binding group for: i

The second  is correct, if course, but the first is not.

If I change the new binding to i' instead of i (and the 
references below, of course) *both* messages go away!

Please let me know if you'd like more information, a 
shorter error case, etc.
Trac metadata
Trac field Value
Version 6.4
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution ResolvedRejected
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