#4985: Improve locations in ghci errors
---------------------------------+------------------------------------------
Reporter: igloo | Owner:
Type: bug | Status: new
Priority: normal | Milestone: 7.0.3
Component: Compiler | Version: 7.0.1
Keywords: | Testcase:
Blockedby: | Difficulty:
Os: Unknown/Multiple | Blocking:
Architecture: Unknown/Multiple | Failure: None/Unknown
---------------------------------+------------------------------------------
This shows GHC complaining of an error in line 9 of a 7 line file. The
error is really on line 4. My guess is it's adding the line within the
`:{` ... `:}` to the line of the `:}`, in which case the best fix is
probably to remember the position of the `:{` and set the line number to
that when evaluating the expression.
{{{
Prelude> :! cat script_me
:{
let y1 = 1
y2 = 2
Y3 = 3
y4 = 4
y5 = 5
:}
Prelude> :! wc -l script_me
7 script_me
Prelude> :script script_me
script_me:9:5: Not in scope: data constructor `Y3'
}}}
Additionally, errors in `.ghci` files currently have `<interactive>` as
their location. Probably `sourceConfigFile` in `ghc/InteractiveUI.hs`
should set the filename.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4985>
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