Testsuite: tabs -> spaces [skip ci]
[ghc.git] / testsuite / tests / gadt / T2040.hs
1 {-# LANGUAGE GADTs, ScopedTypeVariables, FlexibleContexts,
2 MultiParamTypeClasses #-}
3 {-# OPTIONS_GHC -Wall #-}
4
5 module T2040 where
6
7 data Teq a b where Teq :: Teq a a
8
9 class C a b where proof :: Teq a b
10
11 data S a = S a
12
13 data W b where
14 -- This would make every version of GHC happy
15 -- W :: (C a c , c ~ S b) => W a -> W c
16 W :: C a (S b) => W a -> W (S b)
17
18 foo :: W (S ()) -> W (S ()) -> ()
19 foo (W (_ :: W a1)) (W (_ :: W a2)) =
20 case proof :: Teq a1 (S ()) of
21 Teq -> ()
22
23 foo2 :: W (S ()) -> W (S ()) -> ()
24 foo2 (W (_ :: W a1)) (W (_ :: W a2)) =
25 case proof :: Teq a1 (S ()) of
26 Teq -> case proof :: Teq a2 (S ()) of
27 Teq -> ()