summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_compile/tc204.hs
blob: d95fe864809e641dc022117e37a59365805fb750 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{-# LANGUAGE ImplicitParams #-}
{-# OPTIONS -dcore-lint #-}

-- The dict-bindings attached to an IPBinds 
-- need not be in recursive order.  This is
-- a long-standing bug, which lasted up to 
-- and including GHC 6.4.2

module Bug795(foo) where

data Arg = E Integer | T Bool deriving (Eq, Show)

foo :: Integer -> [Arg] -> IO String
foo 1 as = do { let ?err = "my custom error"
               ; let ws = (show (firstE as))
               ; return (show (firstE as)) }

firstE :: (?err :: String) => [Arg] -> Integer
firstE = error "urk"