summaryrefslogtreecommitdiff
path: root/testsuite/tests/pmcheck/should_compile/T8970.hs
blob: 103a3cd016613f006e079f38351d370d87ec3086 (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
{-# LANGUAGE DataKinds, KindSignatures, GADTs, TypeFamilies #-}
{-# OPTIONS_GHC -fwarn-incomplete-patterns -fwarn-overlapping-patterns #-}

module T8970 where

import Data.Kind (Type)

data K = Foo
       | Bar

data D1 :: K -> Type where
    F1 :: D1 Foo
    B1 :: D1 Bar

class C (a :: K -> Type) where
    data D2 a :: K -> Type
    foo :: a k -> D2 a k -> Bool

instance C D1 where
    data D2 D1 k where
              F2 :: D2 D1 Foo
              B2 :: D2 D1 Bar
    foo F1 F2 = True
    foo B1 B2 = True