Remove the type-checking knot.
[ghc.git] / testsuite / tests / polykinds / T8359.hs
1 {-# OPTIONS_GHC -fno-warn-redundant-constraints #-}
2 {-# LANGUAGE ConstraintKinds, MultiParamTypeClasses #-}
3
4 module T8359 where
5
6 class DifferentTypes a b
7
8 type DifferentTypes3 a b c = (DifferentTypes a b, DifferentTypes b c, DifferentTypes a c)
9
10 class Foo a
11
12 class Bar a
13
14 -- Buggy instance requires UndecidableInstances to compile
15
16 instance (DifferentTypes3 a b c, Bar a, Bar b, Bar c) => Foo (a, b, c)
17
18 -- Equivalent instance compiles when manually expanding constraint type
19 -- instance (DifferentTypes a b, DifferentTypes b c, DifferentTypes a c, Bar a, Bar b, Bar c) => Foo (a, b, c)