summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_compile/tc200.hs
blob: 43eb0947c0103e11547e52e89712308067954401 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
{-# OPTIONS_GHC -w #-}
{-# LANGUAGE ConstrainedClassMethods #-}  -- Needed for 'baz'

-- A nasty case that crashed GHC 6.4 with a Lint error; 
-- see Note [Multiple instantiation] in GHC.Tc.Gen.Expr

module ShouldCompile where

class C a where
  foo :: Eq b => b -> a -> Int
  baz :: Eq a => Int -> a -> Int

instance C Int where
  baz = foo