summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_compile/GivenOverlapping.hs
blob: a0ed41a3fc9a38c29d61c5eb220edbf62fbef95a (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
{-# OPTIONS_GHC -Wno-redundant-constraints -Wno-simplifiable-class-constraints #-}
{-# OPTIONS_GHC -Wno-x-partial #-}
{-# LANGUAGE FunctionalDependencies, FlexibleContexts #-}

class C a where

class D a where
 dop :: a -> a

instance C a => D [a] where
 dop = undefined

class J a b | a -> b
 where j :: a -> b -> ()

instance J Bool Int where
 j = undefined

foo :: D [Int] => ()
-- Weird test case: (D [Int]) is simplifiable
foo = j True (head (dop [undefined]))

main = return ()