summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_fail/tcfail142.hs
blob: 246d568e015e8b78e2e25abb3f6fa0134bb43041 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{-# LANGUAGE Haskell2010 #-}
{-# LANGUAGE MultiParamTypeClasses #-}

-- Tests top-level ambiguity resolution
-- This made a post-6.4 GHC fall over in GHC.Tc.Solver

module ShouldFail where 

class Foo a
instance Foo (a -> b)

foo :: Foo a => a -> ()
foo = undefined

class Bar a r
-- The same happens if we use fundeps:
-- class Bar a r | r -> a

bar :: Bar a r => r -> ()
bar = undefined

test = foo bar