I was looking at
StgToJS and found some suspicious code around
To set the stage: parameters
r to constructs such as
TYPE r (when describing a type's kind) or
(#,#) @r1 @r2 are special, because they describe a runtime representation. But aside from that,
RuntimeRep is just a regular data type; GHC should never do anything special just because a type has that kind. Rather, any special handling should be done based on the fact that a
RuntimeRep is used in a position describing the runtime representation.
As a consequence, every call to
isRuntimeRepKinded here violates this rule:
The last check,
isRuntimeRepKindedTy . idType looks wrong: an Id has a type whose kind should be either
TYPE sth or
CONSTRAINT sth - it cannot be
Low priority - this is cleanup only.