summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_fail/SilentParametersOverlapping.hs
blob: 44ba7039d92d08109368a4f58c3ab3cca892137c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{-# LANGUAGE FlexibleInstances, FlexibleContexts, UndecidableInstances #-}

module SilentParametersOverlapping where 

class C a where 
  c :: a -> () 

class C a => B a where 
  b :: a -> () 

instance C [a] where 
  c x = () 

instance {- silent: C [(a,b)] => -} B [(a,b)] where 
  b x = c [(undefined,undefined)]
  -- We get wanted: C [(gamma, delta)], 
  -- and gamma,delta are unconstrained
  -- We can apply the C [a] instance without difficulty, but
  --  that fails due to silent dfun parameters