Opened 2 years ago

Last modified 8 months ago

#8487 new bug

Debugger confuses variables

Reported by: edsko Owned by:
Priority: normal Milestone:
Component: GHCi Version: 7.7
Keywords: Cc: hvr
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


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)
    a :: String
    a = error "hi"

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

:break 5

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.

Change History (1)

comment:1 Changed 8 months ago by thomie

  • Cc hvr added
  • Component changed from Compiler to GHCi
Note: See TracTickets for help on using tickets.