summaryrefslogtreecommitdiff
path: root/testsuite/tests/gadt/T15009.hs
blob: 58e17af86465de7c083987dcfff48b0c4d1e2c61 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{-# LANGUAGE GADTs #-}

module T15009 where

-- T2 is an ordinary H98 data type,
-- and f2 should typecheck with no problem
data T2 a where
  MkT2 :: a -> T2 a

f2 (MkT2 x) = not x

-- T1 is a GADT, but the equality is really just a 'let'
-- so f1 should also typecheck no problem
data T1 a where
  MkT1 :: b ~ a => b -> T1 a

f1 (MkT1 x) = not x