Opened 5 years ago

Closed 5 years ago

#8461 closed bug (duplicate)

Panic (on woefully incorrect code)

Reported by: srhb Owned by:
Priority: low Milestone:
Component: Compiler Version: 7.6.3
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Compile-time crash Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


The following (very wrong) code causes a panic. The haskeline hackage package is required.

import System.Console.Haskeline
import Control.Monad.State.Strict

main = runStateT (runInputT settings loop) 0
       loop = do
         minput <- lift getInputLine "% "

settings :: Settings (StateT Int IO)
settings = setComplete comp defaultSettings
comp _ = do
  n <- get
  put (n+1)
  return ("", [Completion (show n) "" True])

The error:

[1 of 1] Compiling Main             ( test.hs, test.o )

    Couldn't match kind `* -> *' with `*'
    Expected type: [Char] -> InputT m0 (Maybe String)
      Actual type: [Char] -> InputT m0 (Maybe String)
    Kind incompatibility when matching types:
      [Char] :: * -> *
      [Char] :: *
    The function `lift'ghc: panic! (the 'impossible' happened)
  (GHC version 7.6.3 for x86_64-unknown-linux):
        kindFunResult ghc-prim:GHC.Prim.*{(w) tc 34d}

Please report this as a GHC bug:

PS: It was not clear to me whether to call this a compile-time crash or not. All I know is that the 'impossible' happened. :)

Change History (1)

comment:1 Changed 5 years ago by monoidal

Resolution: duplicate
Status: newclosed

It's already fixed in HEAD: In general lift anything anything causes panic in 7.6. Thanks for reporting.

Note: See TracTickets for help on using tickets.