summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_fail/T6018failclosed2.hs
blob: d90b9decfc0fbac78863fd0e61f2ef72d6f0020c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{-# LANGUAGE TypeFamilies  #-}

module T6018failclosed2 where

-- this one is a strange beast. Last equation is unreachable and thus it is
-- removed. It is then impossible to typecheck barapp and thus we generate an
-- error
type family Bar a = r | r -> a where
    Bar Int  = Bool
    Bar Bool = Int
    Bar Bool = Char

bar :: Bar a -> Bar a
bar x = x

barapp :: Char
barapp = bar 'c'