summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_fail/T18869.hs
blob: b76ea7925138dffe439a101c825f6ade8304334f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
{-# LANGUAGE GADTs #-}
{-# LANGUAGE TypeFamilies #-}

module T18869 where

data Foo where
  MkFoo :: { foo :: !a } -> Foo

testFoo :: Foo
testFoo = MkFoo {}

data Bar where
  MkBar :: ( a ~ Int ) => { bar :: !a } -> Bar

testBar :: Bar
testBar = MkBar {}

data Baz where
  MkBaz :: { baz1 :: !a, baz2 :: !a } -> Baz

testBaz :: Baz
testBaz = MkBaz { baz1 = False }

type family TQuux x where
  TQuux Int = Bool
data Quux a where
  MkQuux :: { quux :: !( TQuux a ) } -> Quux a

testQuux :: Quux Int
testQuux = MkQuux {}