summaryrefslogtreecommitdiff
path: root/testsuite/tests/indexed-types/should_fail/T13972.hs
blob: 9a5af411e2165cc0129fc6c7589c1d94477c5dbb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE TypeFamilies #-}
module Bug where

import Data.Kind

class C (a :: k) where
  type T k :: Type

-- This used to fail, with a mysterious error messate
--    Type indexes must match class instance head
--      Expected: T (a1 -> Either a1 b1)
--      Actual: T (a -> Either a b)
-- but now it succeeds fine

instance C Left where
  type T (a -> Either a b) = Int