Skip to content

($) returning kind # no longer type checks

Given:

{-# LANGUAGE MagicHash #-}
module InnerLoop(go) where
import GHC.Exts
go :: () -> Int#
go () = go $ ()

This type checks fine on GHC 7.2.3, and I have a similar version that works fine with 7.4 and 7.6. However, with GHC 7.8.20140130, I get:

InnerLoop.hs:5:9:
    Kind incompatibility when matching types:
      s0 :: *
      Int# :: #
    In the expression: go $ ()
    In an equation for `go': go () = go $ ()

This code was reduced from this blog post, and code which triggers a similar bug can be found in Shake.

I know $ has special type checking rules, were they removed or changed?

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