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,260
    • Issues 5,260
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 567
    • Merge requests 567
  • 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
  • #984
Closed
Open
Issue created Nov 03, 2006 by guest@trac-guest

Syntax error shows in the wrong position

This bug concerns the behaviour of GHC on erroneous programs. GHC recognizes the illegal syntax, but shows an unrelated error.

This problem is best illustrated in the following code:

f _ = do
        x <- computation
        case () of
                _ ->
                        result <- computation
                        case () of () -> undefined

The error in this code is the missing "do" keyword on line 5, and the compiler should suspect this when seeing the "<-" on line 6. However, GHC gives the following error:

bug.hs:3:8: Parse error in pattern

This is misleading, since the line number is incorrect, and the syntax error (as well is line 3) is unrelated to patterns.

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