Opened 11 years ago

Closed 11 years ago

#2268 closed bug (fixed)

ghci "*** Exception: expectJust upseep1"

Reported by: guest Owned by:
Priority: normal Milestone: 6.8.3
Component: GHCi Version: 6.8.2
Keywords: Cc: tora@…
Operating System: Linux Architecture: x86_64 (amd64)
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

ghci gets confused, reporting "* Exception: expectJust upseep1". I think it's related to having pre-compiled source files that cyclicly import each other, but havn't double checked/proven it.

Trace to reproduce the bug here: (notice that at the start Simplify.hs has a bug in it, and after loading it, but before doing :!cat Simplify.hs I have fixed the error in Simplify.hs)

16:56:38 - tora@colorado:/tmp/GhcBug.hs
>ls
Bookmarks.hs  Bookmarks.hs-boot  Cursor.hs  Simplify.hs

16:56:51 - tora@colorado:/tmp/GhcBug.hs
>ghc --make -c Cursor.hs Bookmarks.hs
[1 of 3] Compiling Bookmarks[boot]  ( Bookmarks.hs-boot, Bookmarks.o-boot )
[2 of 3] Compiling Cursor           ( Cursor.hs, Cursor.o )
[3 of 3] Compiling Bookmarks        ( Bookmarks.hs, Bookmarks.o )

16:57:05 - tora@colorado:/tmp/GhcBug.hs
>cat Simplify.hs 
module HExp.Simplify where

import Cursor(Cursor)

iterateMaybe :: (a -> Maybe a) -> a -> [a]
iterateMaybe f init = init : maybe [] (iterateMaybe) (f init)


16:57:20 - tora@colorado:/tmp/GhcBug.hs
>ghci Simplify.hs 
GHCi, version 6.8.2: http://www.haskell.org/ghc/  :? for help
Loading package base ... linking ... done.
[3 of 4] Compiling HExp.Simplify    ( Simplify.hs, interpreted )

Simplify.hs:6:39:
    Couldn't match expected type `[a]'
           against inferred type `a1 -> [a1]'
    Probable cause: `iterateMaybe' is applied to too few arguments
    In the second argument of `maybe', namely `(iterateMaybe)'
    In the second argument of `(:)', namely
        `maybe [] (iterateMaybe) (f init)'
Failed, modules loaded: Cursor, Bookmarks, Bookmarks.
Prelude Bookmarks> :!cat Simplify.hs 
module HExp.Simplify where

import Cursor(Cursor)

iterateMaybe :: (a -> Maybe a) -> a -> [a]
iterateMaybe f init = init : maybe [] (iterateMaybe f) (f init)

Prelude Bookmarks> :r
*** Exception: expectJust upseep1
> Leaving GHCi.

Attachments (1)

GhciBug.tgz (536 bytes) - added by guest 11 years ago.
source files used to create bug

Download all attachments as: .zip

Change History (2)

Changed 11 years ago by guest

Attachment: GhciBug.tgz added

source files used to create bug

comment:1 Changed 11 years ago by igloo

difficulty: Unknown
Milestone: 6.8.3
Resolution: fixed
Status: newclosed

Thanks for the report. With this Bookmarks.hs-boot:

module Bookmarks where

I can reproduce this with 6.8.2, but not 6.8.3 or the HEAD.

Note: See TracTickets for help on using tickets.