summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_fail/T20542.hs
blob: 20c068dd5938b4bf208236dcb80c9ba69fca5b7b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{-# LANGUAGE TypeSynonymInstances #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}

module T20542 where

class Foo a b where
    foo :: a -> b

instance {-# OVERLAPPABLE #-} Show a => Foo a String where
    foo = show

instance {-# OVERLAPPING #-} Read b => Foo String b where
    foo = read

bar :: String -> String
bar = foo