Opened 11 years ago

Closed 11 years ago

Last modified 4 years ago

#1033 closed bug (fixed)

ghc-6.7: panic! (the 'impossible' happened) -- typechecker getting confused by Data.Generics?

Reported by: int-e Owned by:
Priority: normal Milestone:
Component: Compiler Version: 6.7
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case: tc220
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


This bug is triggered by 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):
    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))
    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.

Change History (4)

comment:1 Changed 11 years ago by simonpj

Resolution: fixed
Status: newclosed
Test Case: tc220

Good bugs, thank you; it exposed bogosity in my work on implication constraints, now fixed.


comment:2 Changed 9 years ago by simonmar

Architecture: UnknownUnknown/Multiple

comment:3 Changed 9 years ago by simonmar

Operating System: UnknownUnknown/Multiple

comment:4 Changed 4 years ago by simonpj <simonpj@…>

In fbdb1520c3bb5048cbe257cd14a96a6dc8e1da2e/ghc:

Add test for Trac #1033
Note: See TracTickets for help on using tickets.