Core Lint error with type families
The following file, found during investigation of #16979 (closed), fails -dcore-lint
. I've checked 8.4, 8.6 and my old copy of master.
{-# LANGUAGE TypeFamilies #-}
module Bug where
import Data.Kind
type family Param :: Type -> Type
type family LookupParam (a :: Type) :: Type where
LookupParam (_ Char) = Bool
LookupParam _ = Int
foo :: LookupParam (Param Bool)
foo = undefined
The error is:
*** Core Lint errors : in result of Desugar (before optimization) ***
Min_w_inc.hs:15:1: warning:
[RHS of foo :: LookupParam (Param Bool)]
Bad axiom application (inconsistent with LookupParam
(_ Char) = Bool
-- Defined at Min_w_inc.hs:11:3)
D:R:LookupParam[1] <Param Bool>_N
<snip>
foo :: LookupParam (Param Bool)
[LclIdX]
foo
= (undefined @ 'LiftedRep @ Int $dIP_a20S)
`cast` (Sub (Sym (D:R:LookupParam[1] <Param Bool>_N))
:: Int ~R# LookupParam (Param Bool))