Opened 5 years ago

Closed 5 years ago

#10004 closed bug (fixed)

rec {} causes "head:empty list" exception

Reported by: alanz Owned by:
Priority: normal Milestone: 7.10.1
Component: Compiler Version: 7.11
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case: mdo/should_compile/T10004
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

Using GHC HEAD 7.11.20150116 (and before)

Trying to load the following into ghci

{-# LANGUAGE RecursiveDo #-}

bar :: IO ()
bar = do
  rec {}
  return ()

results in

> :load "/home/alanz/mysrc/github/alanz/ghc-exactprint/tests/examples/Foo.hs"
[1 of 1] Compiling Main             ( /home/alanz/mysrc/github/alanz/ghc-exactprint/tests/examples/Foo.hs, interpreted )
*** Exception: Prelude.head: empty list
> 

Change History (3)

comment:1 Changed 5 years ago by Simon Peyton Jones <simonpj@…>

In 43636e1b8cf4a6d4752a22b098a9edd0759a7600/ghc:

Fix Trac #10004: head [] exception when using recursive mdo

comment:2 Changed 5 years ago by simonpj

Milestone: 7.10.1
Status: newmerge
Test Case: mdo/should_compile/T10004

Good point. Fixed, thank you

Simon

comment:3 Changed 5 years ago by thoughtpolice

Resolution: fixed
Status: mergeclosed

Merged to ghc-7.10 (via 3748c7311f3b657a9b3c01a48b39874103f46cb9).

Note: See TracTickets for help on using tickets.