Instantiation of invisible type family arguments is too eager
This module looks, to me, like it should be accepted:
{-# LANGUAGE TypeInType, RankNTypes, TypeFamilies #-}
module Bug where
import Data.Kind
type family F :: forall k2. (k1, k2)
data T :: (forall k2. (Bool, k2)) -> Type
type S = T F
But it's not. The problem is that TcHsType.handle_tyfams
eagerly instantiates all invisible arguments to a type family at every occurrence. Instead, it should instantiate only those that are counted in the TF's arity -- that is, those "before the colon".
Will fix.
Trac metadata
Trac field | Value |
---|---|
Version | 8.0.1 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |