44e5865177eee2476b9d6e3ff46ac408353c66a2
[ghc.git] / testsuite / tests / indexed-types / should_compile / T10931.hs
1 {-# LANGUAGE FlexibleContexts #-}
2 {-# LANGUAGE TypeFamilies #-}
3 {-# LANGUAGE RankNTypes #-}
4
5 {-# OPTIONS_GHC -Wall #-}
6
7 module T10931 ( BugC(..) ) where
8
9 data IdT f a = IdC (f a)
10
11 class ( m ~ Outer m (Inner m) ) => BugC (m :: * -> *) where
12 type Inner m :: * -> *
13 type Outer m :: (* -> *) -> * -> *
14
15 bug :: ( forall n. ( n ~ Outer n (Inner n)
16 , Outer n ~ Outer m
17 )
18 => Inner n a)
19 -> m a
20
21 instance BugC (IdT m) where
22 type Inner (IdT m) = m
23 type Outer (IdT _) = IdT
24
25 bug f = IdC f