Skip to content

type inference regression when faking injective type families

ghc-7.10.0.20141222 does not accept the program unless I uncomment the type signature (a :: a). ghc-7.8 accepts it as-is.

{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}

class (UnF (F a) ~ a, Show a) => C a where
    type F a
    f :: F a -> a

type family UnF a

g :: forall a. C a => a -> String
g _ = show a
  where a = f (undefined :: F a) -- :: a
Trac metadata
Trac field Value
Version 7.10.1-rc1
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