Opened 6 months ago

Closed 6 months 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 Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

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
   where 
       loop = do
         minput <- lift getInputLine "% "
         loop

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 )

test.hs:7:20:
    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:  http://www.haskell.org/ghc/reportabug

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 6 months ago by monoidal

  • Resolution set to duplicate
  • Status changed from new to closed

It's already fixed in HEAD: http://ghc.haskell.org/trac/ghc/search?q=kindFunResult. In general lift anything anything causes panic in 7.6. Thanks for reporting.

Note: See TracTickets for help on using tickets.