Skip to content

Core Lint error with representation polymorphism and zonking

The following program fails Lint on master

module M where

import GHC.Exts

f :: forall r s (a :: TYPE (r s)). a -> ()
f = f

g h = f (h ())
*** Core Lint errors : in result of Desugar (after optimization) ***
Y.hs:8:3: warning:
    Argument does not have a fixed runtime representation h_aiQ
                                                            () :: (a_aH5 :: TYPE (Any Any))
    In the RHS of g :: forall {a :: TYPE (Any Any)}. (() -> a) -> ()

This is because we have a concrete r s :: RuntimeRep that needs to be defaulted. It becomes Any Any but that's not a valid fixed representation.

I will submit a patch.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information