Core Lint error: Non-*-like kind when *-like expected: * -> *
See main ticket #22063
This triggers a Core Lint error: "Non-*
-like kind when *
-like expected: * -> *
"
{-# Language RankNTypes #-}
{-# Options_GHC -dcore-lint #-}
import Data.Kind
-- type HoLim :: (k -> k1 -> Type) -> (k1 -> Type)
type HoLim f a = (forall x. f x) a
hoCone :: HoLim f b -> f a b
hoCone _ = undefined
$ ghci810b File.hs
GHCi, version 8.10.0.20191123: https://www.haskell.org/ghc/ :? for help
[1 of 1] Compiling Main ( File.hs, interpreted )
*** Core Lint errors : in result of Desugar (before optimization) ***
File.hs:10:1: warning:
Non-*-like kind when *-like expected: * -> *
when checking the body of forall: forall x. f_aB2 x
In the type of a binder: hoCone
In the type ‘forall (f :: * -> * -> *) b a. HoLim f b -> f a b’
Substitution: [TCvSubst
In scope: InScope {x_aB1 f_aB2 b_aB3 a_aB4 $trModule}
Type env: []
Co env: []]
*** Offending Program ***
Rec {
$trModule :: Module
[LclIdX]
$trModule = Module (TrNameS "main"#) (TrNameS "Main"#)
hoCone :: forall (f :: * -> * -> *) b a. HoLim f b -> f a b
[LclIdX]
hoCone
= \ (@ (f_aBT :: * -> * -> *)) (@ b_aBU) (@ a_aBV) ->
let {
$dIP_a1nS :: ?callStack::CallStack
[LclId]
$dIP_a1nS
= emptyCallStack
`cast` (Sym (N:IP[0] <"callStack">_N <CallStack>_N)
:: CallStack ~R# (?callStack::CallStack)) } in
let {
$dIP_a1nM :: HasCallStack
[LclId]
$dIP_a1nM
= (pushCallStack
(unpackCString# "undefined"#,
SrcLoc
(unpackCString# "main"#)
(unpackCString# "Main"#)
(unpackCString# "File.hs"#)
(I# 10#)
(I# 12#)
(I# 10#)
(I# 21#))
($dIP_a1nS
`cast` (N:IP[0] <"callStack">_N <CallStack>_N
:: (?callStack::CallStack) ~R# CallStack)))
`cast` (Sym (N:IP[0] <"callStack">_N <CallStack>_N)
:: CallStack ~R# (?callStack::CallStack)) } in
\ (ds_d1ob :: HoLim f_aBT b_aBU) ->
break<0>() undefined @ 'LiftedRep @ (f_aBT a_aBV b_aBU) $dIP_a1nM
end Rec }
*** End of Offense ***
<no location info>: error:
Compilation had errors
*** Exception: ExitFailure 1
>
``
Edited by Simon Peyton Jones