#3746: Poor parse error
---------------------------------+------------------------------------------
Reporter: NeilMitchell | Owner:
Type: bug | Status: new
Priority: normal | Component: Compiler
Version: 6.10.4 | Keywords:
Os: Unknown/Multiple | Testcase:
Architecture: Unknown/Multiple | Failure: None/Unknown
---------------------------------+------------------------------------------
Given the fragment:
{{{
f x = do case x of
Just foo -> do
stmt1
stmt2
stmt3
stmt4
stmt5
stmt6
Nothing ->
a <- var
stmt1
stmt2
stmt3
}}}
There is a parse error after the {{{Nothing}}}, I should have included a
{{{do}}}.
GHC says:
{{{
bug.hs:1:9: Parse error in pattern
}}}
This error message can be made to be arbitrarily far away from the point
at which the error actually occurs.
Haskell-src-exts does far better with:
{{{
bug.hs:10:19: Parse error in pattern
}}}
Reporting {{{<-}}} binding errors against the arrow, rather than the
(assumed) start of the pattern seems to be a better choice.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3746>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs