Opened 6 months ago

#8487 new bug

Debugger confuses variables

Reported by: edsko Owned by:
Priority: normal Milestone:
Component: Compiler Version: 7.7
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

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.

Change History (0)

Note: See TracTickets for help on using tickets.