summaryrefslogtreecommitdiff
path: root/testsuite/tests/indexed-types/should_fail/T14045a.hs
blob: 985220c472e5e6a5e241612e903b67b3a29845c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{-# LANGUAGE TypeFamilies, PolyKinds, DataKinds, GADTs, FlexibleInstances #-}

module T14045a where

import Data.Kind

class C (a :: k) where
  data S (a :: k)

-- This used to fail with the mysterious error
--   Type indexes must match class instance head
--     Expected: S z
--     Actual: S a
-- But now it is fine
instance C (z :: Bool) where
  data S :: Bool -> Type where
    SF :: S False
    ST :: S True