Skip to content

Poorly formatted Core Lint error from lintAxioms

Taken from @RyanGlScott's #15979 (comment 302980)

{-# LANGUAGE DataKinds #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE ImpredicativeTypes #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE UnliftedNewtypes #-}
module Bug where

import Data.Functor.Identity
import GHC.Exts

newtype T :: TYPE (forall r. TupleRep '[r]) where
  MkT :: Any @(TYPE (forall r. TupleRep '[r])) -> T

when compiled with -dcore-lint, will produce

Bug.hs:1:1: error:
    Bug.hs:12:1: warning:
        Non-*-like kind when *-like expected: RuntimeRep
        when checking the body of forall: 'TupleRep '[r]
        In the coercion axiom Bug.N:T :: []. Bug.T ~_R Any
        Substitution: [TCvSubst
                         In scope: InScope {r}
                         Type env: [axl :-> r]
                         Co env: []]
  |
1 | {-# LANGUAGE DataKinds #-}
  | ^

Note the weird nested header and the wrong location. And it doesn't even say it's a core-lint error. Very strange.

The problem is that this error is produced by lintAxioms, run separately from other core-linting.

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