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

-- We want to get the type
--      g :: forall a b c.  C a (b,c) => a -> b
--but GHC 6.0 bogusly gets
--      g :: forall a b.  C a (b,()) => a -> b

-- Having done this, we reject f on the grounds
-- that its type is ambiguous: adding the type
-- signature   g :: C a (b,c) => a -> b
-- would fail

module ShouldFail where

class C a b where { op :: a -> b }

g x = fst (op x)