summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_compile/Improvement.hs
blob: 3e15139853b58697763027a15292ff385392827a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
{-# LANGUAGE TypeFamilies, FlexibleContexts, MultiParamTypeClasses, FlexibleInstances #-}
{-# OPTIONS_GHC -fno-warn-redundant-constraints #-}

-- This one relies on doing instance reduction
-- on a /derived/ class
--    [W] C (F a0) a0, F a0 ~ Bool
-- Currently (Oct 16) I've disabled this because it seems like
-- overkill.
--
-- See Note Note [No reduction for Derived class constraints]
-- in GHC.Tc.Solver.Interact

module Foo where

type family F a
type instance F Int = Bool

class C a b where

instance (b~Int) => C Bool b

blug :: C (F a) a => a -> F a
blug = error "Urk"

foo :: Bool
foo = blug undefined