Opened 4 years ago
Closed 4 years ago
#8461 closed bug (duplicate)
Panic (on woefully incorrect code)
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:
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 4 years ago by
Note: See TracTickets for help on using tickets.
It's already fixed in HEAD:. In general
lift anything anythingcauses panic in 7.6. Thanks for reporting.