[GHC] #1033: ghc-6.7: panic! (the 'impossible' happened) --
typechecker getting confused by Data.Generics?
GHC
trac at galois.com
Thu Nov 30 03:39:48 EST 2006
#1033: ghc-6.7: panic! (the 'impossible' happened) -- typechecker getting confused
by Data.Generics?
-------------------------+--------------------------------------------------
Reporter: int-e | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 6.7
Severity: normal | Keywords:
Difficulty: Unknown | Testcase:
Architecture: Unknown | Os: Unknown
-------------------------+--------------------------------------------------
This bug is triggered by
[http://www.cse.unsw.edu.au/~dons/lambdabot/Lib/Pointful.hs]. A reduced
test case follows.
{{{
{-# OPTIONS_GHC -fglasgow-exts #-}
module Pointful' where
import Language.Haskell.Syntax
import Data.Generics
import Control.Monad.State
-- rename :: () -> HsExp -> State (HsName, [HsName]) HsExp
rename = \_ -> everywhereM (mkM (\e -> case e of HsWildCard -> return e))
{-
Pointful.hs:9:0:ghc-6.7: panic! (the 'impossible' happened)
(GHC version 6.7 for i386-unknown-linux):
dictPred
ic{v a1nF} :: {forall a{tv a1iH} [sk].
(base:Data.Generics.Basics.Data{tc 29} a{tv a1iH} [sk])
=>
<pred>base:GHC.Base.Monad{tc 28} m{tv a1nq} [tau]}
Refinement {[]}
-}
-- rename _ = everywhereM (mkM (\e -> case e of HsWildCard -> return e))
{-
Pointful.hs:30:17:
Couldn't match expected type `Monad m' against inferred type `()'
In the first argument of `rename', namely `()'
In the expression: rename () undefined
In the definition of `uncomb'': uncomb' = rename () undefined
-}
uncomb' :: State (HsName, [HsName]) HsExp
uncomb' = rename () undefined
}}}
The errors can be reproduced by uncommenting the line immediately
preceding it (and commenting out the other one). In both cases the error
can be fixed by uncommenting the type signature for {{{rename}}}.
Tested with ghc-6.7 as of 2006-11-27. ghc-6.6 and ghc-6.4.2 are both fine.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1033>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the Glasgow-haskell-bugs
mailing list