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

-- #289

module ShouldCompile where

class Foo a where
  foo :: a -> Int

data T = forall a. T (G a)
data G a where
  A :: G a
  B :: Foo a => a -> G a

doFoo :: T -> Int
doFoo (T A) = 2
doFoo (T (B x)) = foo x