Embrace -XTypeInType, add -XStarIsType
[ghc.git] / testsuite / tests / indexed-types / should_fail / T4174.hs
1 {-# LANGUAGE TypeFamilies, TypeOperators, EmptyDataDecls #-}
2
3 module T4174 where
4
5 import Data.Kind (Type)
6
7 data True
8 data False
9
10 data Minor1
11
12 data GHC6'8 m
13 data GHC6'10 m
14
15 type family a :<=: b :: {-Bool-} Type
16 type instance GHC6'10 m1 :<=: GHC6'8 m2 = False
17
18 type a :>=: b = b :<=: a
19
20 data Way ghcVersion tablesNextToCode profiling threaded
21
22 type family GHCVersion way :: {-GHCVersion-} Type
23 type instance GHCVersion (Way v n p t) = v
24
25 type family Threaded way :: {-Bool-} Type
26 type instance Threaded (Way v n p t) = t
27
28 data Field w s t
29 data SmStep
30 data RtsSpinLock
31
32 field :: String -> m (Field w a b)
33 field = undefined
34
35 type family WayOf (m :: Type -> Type) :: Type
36
37 sync_large_objects :: (Monad m,
38 (GHCVersion (WayOf m) :>=: GHC6'10 Minor1) ~ True,
39 Threaded (WayOf m) ~ True)
40 => m (Field (WayOf m) SmStep RtsSpinLock)
41 sync_large_objects = field "sync_large_objects"
42
43 testcase :: Monad m => m (Field (Way (GHC6'8 minor) n t p) a b)
44 testcase = sync_large_objects
45
46 {- Wanted constraints from the occurrence of sync_large_objects
47
48 (WayOf m) ~ (Way (GHC6'8 minor) n t p)
49 a ~ SmStep
50 b ~ RtsSpinLock
51
52 Threaded (WayOf m) ~ True
53 == Threaded (Way (GHC6'8 minor) n t p) ~ True
54 == p ~ True
55
56 (GHCVersion (WayOf m) :>=: GHC6'10 Minor1) ~ True,
57 == (GHC6'10 Minor1 :<=: GHCVersion (WayOf m)) ~ True,
58 == (GHC6'10 Minor1 :<=: GHCVersion (Way (GHC6'8 minor) n t p))) ~ True,
59 == (GHC6'10 Minor1 :<=: GHC6'8 minor) ~ True
60 == False ~ True
61
62 -}