Assertion failure with ghci -fdefer-type-errors
To reproduce:
$ ./stage1/bin/ghc --interactive
GHCi, version 9.9.20230927: https://www.haskell.org/ghc/ :? for help
ghci> :set -fdefer-type-errors
ghci> :kind Int Int
panic! (the 'impossible' happened)
GHC version 9.9.20230927:
ASSERT failed!
{[W] co_aBU
= case typeError
@LiftedRep
@()
"<interactive>:1:1: error: [\ESC]8;;https://errors.haskell.org/messages/GHC-83865\ESC\\GHC-83865\ESC]8;;\ESC\\]\n\
\ \\226\\128\\162 Expected kind \\226\\128\\152* -> k0\\226\\128\\153, but \\226\\128\\152Int\\226\\128\\153 has kind \\226\\128\\152*\\226\\128\\153\n\
\ \\226\\128\\162 In the type \\226\\128\\152Int Int\\226\\128\\153\n\
\(deferred type error)"#
of {}}
Call stack:
CallStack (from HasCallStack):
massertPpr, called at compiler/GHC/Tc/Module.hs:2626:10 in ghc-9.9-inplace:GHC.Tc.Module
CallStack (from HasCallStack):
panic, called at compiler/GHC/Utils/Error.hs:511:29 in ghc-9.9-inplace:GHC.Utils.Error
Even with assertions off we get a rather silly output
:set -fdefer-type-errors
ghci> :k Int Int
<interactive>:1:1: warning: [GHC-83865] [-Wdeferred-type-errors]
• Expected kind ‘* -> k0’, but ‘Int’ has kind ‘*’
• In the type ‘Int Int’
Int Int :: k