[GHC] #7905: Type checker barfs on nonsensical expression

#7905: Type checker barfs on nonsensical expression -------------------------------+-------------------------------------------- Reporter: jpaugh | Owner: Type: bug | Status: new Priority: normal | Component: Compiler Version: 7.6.2 | Keywords: Os: Linux | Architecture: x86 Failure: Compile-time crash | Blockedby: Blocking: | Related: -------------------------------+-------------------------------------------- I got the infamous "impossible bug" by trying something nonsensical in my program. I reproduced the bug in the attached minimal program (18 lines). The precise error message is: {{{ Impossible.hs:18:5: Couldn't match kind `* -> *' with `*' Expected type: [Char] -> ZT IO () Actual type: [Char] -> ZT IO () Kind incompatibility when matching types: [Char] :: * -> * [Char] :: * The function `lift'ghc: panic! (the 'impossible' happened) (GHC version 7.6.2 for i386-unknown-linux): kindFunResult ghc-prim:GHC.Prim.*{(w) tc 34d} }}} Note that this error occurs whether on not the ''MonadTrans'' instance is there. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7905 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7905: Type checker barfs on nonsensical expression ---------------------------------+------------------------------------------ Reporter: jpaugh | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.6.2 Resolution: fixed | Keywords: Os: Linux | Architecture: x86 Failure: Compile-time crash | Difficulty: Unknown Testcase: | Blockedby: Blocking: | Related: ---------------------------------+------------------------------------------ Changes (by simonpj): * status: new => closed * difficulty: => Unknown * resolution: => fixed Comment: HEAD is happy: {{{ T7905.hs:18:5: Couldn't match type (->) s0 with [Char] Expected type: [Char] -> ZT IO () Actual type: t0 ((->) s0) (ZT IO ()) The function lift is applied to two arguments, but its type (s0 -> ZT IO ()) -> t0 ((->) s0) (ZT IO ()) has only one In the expression: lift gPrint "a" In an equation for d : d = lift gPrint "a" T7905.hs:18:10: Couldn't match type Identity with IO Expected type: s0 -> ZT IO () Actual type: s0 -> ZT Identity () In the first argument of lift , namely gPrint In the expression: lift gPrint "a" }}} (I had to import `Identity` from `Data.Functor` rather than `Control.Monad.Identity`.) So I think this is already fixed. Reopen if you disagree. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7905#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC