[GHC] #8487: Debugger confuses variables

GHC ghc-devs at haskell.org
Wed Oct 30 08:34:10 UTC 2013


#8487: Debugger confuses variables
------------------------------------+-------------------------------------
       Reporter:  edsko             |             Owner:
           Type:  bug               |            Status:  new
       Priority:  normal            |         Milestone:
      Component:  Compiler          |           Version:  7.7
       Keywords:                    |  Operating System:  Unknown/Multiple
   Architecture:  Unknown/Multiple  |   Type of failure:  None/Unknown
     Difficulty:  Unknown           |         Test Case:
     Blocked By:                    |          Blocking:
Related Tickets:                    |
------------------------------------+-------------------------------------
 Consider the following example:

 {{{
 import Control.Exception

 f = do
   ma <- try $ evaluate a
   case ma of
     Right str -> return a
     Left  err -> return $ show (err :: SomeException)
   where
     a :: String
     a = error "hi"
 }}}

 Load into ghci, set a breakpoint on the 5th line, then run f:

 {{{
 :break 5
 f
 }}}

 You will get

 {{{
 Stopped at Ex.hs:(5,3)-(7,53)
 _result :: IO String = _
 a :: Either SomeException String = Left _
 }}}

 This doesn't make sense. `a` has type `String`; it is `ma` that has type
 `Either SomeException String`.

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


More information about the ghc-tickets mailing list