summaryrefslogtreecommitdiff
path: root/testsuite/tests/polykinds/T8359.hs
blob: 00fabf86a921eaee7d4a5f7a9cbc9172bc72a214 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{-# OPTIONS_GHC -fno-warn-redundant-constraints #-}
{-# LANGUAGE ConstraintKinds, MultiParamTypeClasses #-}

module T8359 where

class DifferentTypes a b

type DifferentTypes3 a b c = (DifferentTypes a b, DifferentTypes b c, DifferentTypes a c)

class Foo a

class Bar a

-- Buggy instance requires UndecidableInstances to compile

instance (DifferentTypes3 a b c, Bar a, Bar b, Bar c) => Foo (a, b, c)

-- Equivalent instance compiles when manually expanding constraint type
-- instance (DifferentTypes a b, DifferentTypes b c, DifferentTypes a c, Bar a, Bar b, Bar c) => Foo (a, b, c)