Opened 9 months ago

Last modified 9 months ago

#12742 new bug

Instantiation of invisible type family arguments is too eager

Reported by: goldfire Owned by: goldfire
Priority: normal Milestone:
Component: Compiler Version: 8.0.1
Keywords: TypeInType Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: GHC rejects valid program Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


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.

Change History (1)

comment:1 Changed 9 months ago by simonpj

Keywords: TypeInType added
Note: See TracTickets for help on using tickets.