`mkTick` can cause core lint errors by separating functions from type arguments.
We start with
reallyUnsafePtrEquality
= \ (@a_akM) ->
(reallyUnsafePtrEquality#) @'Lifted @'Lifted @a_akM @a_akM
We call mkTick scc e
on the expression (reallyUnsafePtrEquality#) @'Lifted @'Lifted @a_akM @a_akM
This floats the scc tick in between the type applications giving us this lint error/result:
*** Core Lint errors : in result of Add late core cost-centres ***
libraries/ghc-prim/GHC/Prim/PtrEq.hs:71:1: warning:
Cannot eta expand ‘reallyUnsafePtrEquality#’
The following types do not have a fixed runtime representation:
• a_11 :: TYPE ('BoxedRep l_1c)
• b_12 :: TYPE ('BoxedRep k_1b)
In the RHS of reallyUnsafePtrEquality :: forall a. a -> a -> Int#
In the body of lambda with binder a_akM :: *
Substitution: [TCvSubst
In scope: InScope {a_akM}
Type env: [akM :-> a_akM]
Co env: []]
*** Offending Program ***
reallyUnsafePtrEquality :: forall a. a -> a -> Int#
[LclIdX,
Arity=2,
Str=<L><L>,
Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True,
Guidance=ALWAYS_IF(arity=0,unsat_ok=True,boring_ok=True)}]
reallyUnsafePtrEquality
= \ (@a_akM) ->
(src<libraries/ghc-prim/GHC/Prim/PtrEq.hs:72:1-50>
tick<reallyUnsafePtrEquality> reallyUnsafePtrEquality#)
@'Lifted @'Lifted @a_akM @a_akM
I think the program might be fine in the end. So it's not clear to me if mkTick should be changed or how we lint such expressions.