
#12987: Core lint error with levity polymorphism
-------------------------------------+-------------------------------------
Reporter: Iceland_jack | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 8.0.1
Keywords: | Operating System: Unknown/Multiple
LevityPolymorphism |
Architecture: | Type of failure: None/Unknown
Unknown/Multiple |
Test Case: | Blocked By:
Blocking: | Related Tickets:
Differential Rev(s): | Wiki Page:
-------------------------------------+-------------------------------------
{{{
$ ghci -ignore-dot-ghci
GHCi, version 8.0.1: http://www.haskell.org/ghc/ :? for help
Prelude> import GHC.Types
Prelude GHC.Types> :set -XTypeInType
Prelude GHC.Types> class NUM (a :: TYPE rep) where add :: a -> a -> a
Prelude GHC.Types>
}}}
works, but with `-dcore-lint` I get a core lint error
{{{
$ ghci -ignore-dot-ghci
GHCi, version 8.0.1: http://www.haskell.org/ghc/ :? for help
Prelude> import GHC.Types
Prelude GHC.Types> :set -XTypeInType
Prelude GHC.Types> :set -dcore-lint
Prelude GHC.Types> class NUM (a :: TYPE rep) where add :: a -> a -> a
*** Core Lint errors : in result of Tidy Core ***
<no location info>: warning:
In the type ‘forall a_a17Q.
NUM a_a17Q =>
a_a17Q -> a_a17Q -> a_a17Q’
Ill-kinded argument in type or kind ‘a_a17Q -> a_a17Q’
type or kind ‘a_a17Q -> a_a17Q’ kind: TYPE rep_a17P
<no location info>: warning:
In the type ‘forall a_a17Q.
NUM a_a17Q =>
a_a17Q -> a_a17Q -> a_a17Q’
Ill-kinded argument in type or kind ‘a_a17Q -> a_a17Q -> a_a17Q’
type or kind ‘a_a17Q -> a_a17Q -> a_a17Q’ kind: TYPE rep_a17P
*** Offending Program ***
add [InlPrag=INLINE]
:: forall a_a17Q. NUM a_a17Q => a_a17Q -> a_a17Q -> a_a17Q
[GblId[ClassOp],
Arity=1,
Caf=NoCafRefs,
Str=DmdType ,
Unf=Unf{Src=InlineStable, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True,
Guidance=ALWAYS_IF(arity=1,unsat_ok=False,boring_ok=True)
Tmpl= \ (@ (rep_a17P :: RuntimeRep))
(@ (a_a17Q :: TYPE rep_a17P))
(tpl_B1 [Occ=Once] :: NUM a_a17Q) ->
tpl_B1
`cast` (N:NUM[0]