Don't skip validity checks for built-in classes (#17355)
[ghc.git] / testsuite / tests / typecheck / should_compile / tc244.hs
1 {-# LANGUAGE TypeFamilies, GADTs #-}
2
3 -- Tests record update in the presence of
4 -- existentials, GADTs, type families
5
6 module Rec where
7
8 ----------------- Existential
9 data S a where
10 S1 :: { fs1 :: a, fs2 :: b } -> S a
11 S2 :: { fs1 :: a } -> S a
12
13 updS s x = s { fs1=x }
14
15 {-
16 ------------------ GADT
17 data T a b where
18 T1 :: { ft1 :: a, ft2 :: c, ft3 :: d } -> T a Int
19 T2 :: { ft1 :: a, ft3 :: c } -> T a Int
20 T3 :: T Int b
21
22 f :: T a1 b -> a2 -> T a2 b
23 f x v = x { ft1 = v }
24
25 ------------------ Type family
26 data family R a
27 data instance R (a,b) where
28 R1 :: { fr1 :: a, fr2 :: b, fr3 :: c } -> R (a,b)
29 R2 :: { fr1 :: a, fr3 :: c } -> R (a,b)
30
31 updR r x = r { fr1=x }
32 -}