Syntax error shows in the wrong position
|Reported by:||guest||Owned by:|
|Keywords:||syntax parse case do||Cc:|
|Type of failure:||None/Unknown||Difficulty:||Unknown|
|Test Case:||T984||Blocked By:|
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.
Change History (10)
comment:1 Changed 7 years ago by simonmar
- Architecture changed from x86 to Multiple
- Milestone set to _|_
- Operating System changed from Linux to Multiple
- Priority changed from normal to low
- severity changed from normal to minor
comment:6 Changed 6 years ago by simonmar
- Operating System changed from Multiple to Unknown/Multiple