Ticket #1442 (closed bug: invalid)

Opened 6 years ago

Last modified 5 years ago

ghc and ghci differs in deailing with "undefined" with I/O

Reported by: guest Owned by:
Priority: normal Milestone:
Component: Compiler Version: 6.6.1
Keywords: Cc: levent.erkok@…, jeff@…
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

This program:

main = putStrLn ("x == " ++ undefined)

produces the following expected output with ghci:

x == *** Exception: Prelude.undefined

but when compiled with ghc and run, it gives:

$./a.out 
a.out: Prelude.undefined

we observed this in all the way back to ghc6.2.1; possibly earlier.

The semantics of error reporting in combination with I/O is murky; admittedly laziness is observable at the top-level when errors are reported. But at least ghc and ghci should do the same thing. And the behavior of ghci seems to be more appropriate.

Thanks!

Jeff Lewis and Levent Erkok

Change History

Changed 6 years ago by neil

Is this not just line buffering versus character buffer? Try hSetBuffering and I think these will have the same behaviour. (Apart from giving the program name versus Exception)

Changed 6 years ago by guest

  • status changed from new to closed
  • resolution set to invalid

apologies; false alarm while trying to track down some other issue!

this isn't a bug.

Changed 5 years ago by simonmar

  • architecture changed from Unknown to Unknown/Multiple

Changed 5 years ago by simonmar

  • os changed from Unknown to Unknown/Multiple
Note: See TracTickets for help on using tickets.