intermittent type checker AWOL bug?

Claus Reinke claus.reinke at talk21.com
Wed Jun 18 13:51:49 EDT 2008


have any type checker loop bugs been fixed recently? 
I have a piece of code for which:

    GHCi 6.6.1 reports an error
    GHCi, version 6.9.20080217 loops
    GHCi, version 6.9.20080514 reports an error

and I just want to make sure that this is a known and fixed
bug, not something that has come out of hiding too briefly
to be fixed properly.

Claus

--
this erroneous code fragment sends `GHCi, version 6.9.20080217` into a loop:
{{{
{-# OPTIONS_GHC -fglasgow-exts #-}
data HsDoc id
  = DocEmpty
  | DocParagraph (HsDoc id)

gfoldl' :: (forall a b . c (a -> b) -> a -> c b) -> (forall g . g -> c g) -> a -> c a
gfoldl' k z hsDoc = case hsDoc of
  DocEmpty                  -> z DocEmpty
  (DocParagraph hsDoc)      -> z DocParagraph `k` hsDoc
}}}
I haven't waited more than a couple of minutes, because GHCi 6.6.1 immediately finds the bug:
{{{
C:/Documents and Settings/cr3/Desktop/Typo.hs:10:2:
    Couldn't match expected type `a' (a rigid variable)
           against inferred type `HsDoc id'
      `a' is bound by the type signature for `gfoldl''
        at C:/Documents and Settings/cr3/Desktop/Typo.hs:8:77
    In the pattern: DocEmpty
    In a case alternative: DocEmpty -> z DocEmpty
    In the expression:
        case hsDoc of
          DocEmpty -> z DocEmpty
          (DocParagraph hsDoc) -> (z DocParagraph) `k` hsDoc
Failed, modules loaded: none.
}}}
I was about to create a ticket for this when I recalled having a 
newer ghc to check with and, surprise, GHCi, version 6.9.20080514
does not suffer from this issue.




More information about the Cvs-ghc mailing list