Skip to content

Couldn't match kind `BOX' against `*' when using SOURCE import

When this module has a (useless) SOURCE import, using its typeclass gives an error.

module Bar where
import {-# SOURCE #-} Foo
class Bar a (p :: Bool) | a -> p
data Proxy a = Proxy

With the interpreter, the error appears when using the class:

Prelude> :l Bar
*Bar> :set -XFlexibleContexts -XDataKinds
*Bar> Proxy :: Bar '() a => Proxy a
    Couldn't match kind `BOX' against `*'
    Kind incompatibility when matching types:
      k0 :: BOX
      Bool :: *

When compiling, the error appears the *second* run.

$ ghc Main.hs
No instance for (Bar () '() a0)
$ ghc Main.hs
Couldn't match kind `BOX' against `*'

Tested with 7.4.1 and HEAD

Trac metadata
Trac field Value
Version 7.4.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information