[GHC] #10578: ghci line numbers are off by one

GHC ghc-devs at haskell.org
Fri Jun 26 16:32:49 UTC 2015


#10578: ghci line numbers are off by one
-------------------------------------+-------------------------------------
              Reporter:  rwbarton    |             Owner:
                  Type:  bug         |            Status:  new
              Priority:  low         |         Milestone:
             Component:  GHCi        |           Version:  7.10.1
              Keywords:  newcomer    |  Operating System:  Unknown/Multiple
          Architecture:              |   Type of failure:  None/Unknown
  Unknown/Multiple                   |        Blocked By:
             Test Case:              |   Related Tickets:
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------
 {{{
 rwbarton at morphism:/tmp$ ghci-7.10.1
 GHCi, version 7.10.1: http://www.haskell.org/ghc/  :? for help
 Prelude> 3 : 'a'

 <interactive>:2:5:
     Couldn't match expected type ‘[a]’ with actual type ‘Char’
     Relevant bindings include it :: [a] (bound at <interactive>:2:1)
     In the second argument of ‘(:)’, namely ‘'a'’
     In the expression: 3 : 'a'
     In an equation for ‘it’: it = 3 : 'a'
 Prelude> 3 : 'a'

 <interactive>:3:5:
     Couldn't match expected type ‘[a]’ with actual type ‘Char’
     Relevant bindings include it :: [a] (bound at <interactive>:3:1)
     In the second argument of ‘(:)’, namely ‘'a'’
     In the expression: 3 : 'a'
     In an equation for ‘it’: it = 3 : 'a'
 Prelude>
 }}}

 Why are the errors reported as being on lines 2 and 3? And no, I don't buy
 that line 1 was the GHCi welcome message :)

 Apparently it's been like this since at least GHC 7.4 and I've never
 noticed.

 `ghc -e cmd1 -e cmd2` reports every command as beginning on a new line 1,
 which is also weird.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10578>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list