summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_compile/T14434.hs
blob: a0d0442fedff0e9a197a6d6f71169f08f13e9c7d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{-# LANGUAGE MonoLocalBinds, FlexibleInstances, OverloadedStrings #-}
{-# OPTIONS -fsolve-constant-dicts #-}

module T14434 where

class ToString a where
  toString :: a -> String

-- | This instance is used in original code as hack
-- to simplify code generation
instance {-# OVERLAPPABLE #-} ToString a where
  toString _ = "Catchall attribute value"

toStringX :: (ToString a) => a -> String
toStringX = toString
  -- Here we do /not/ want to solve the ToString
  -- constraint with the local instance