summaryrefslogtreecommitdiff
path: root/testsuite/tests/indexed-types/should_compile/UnusedTyVarWarningsNamedWCs.hs
blob: b78626f4022fcc49bcda2afb510b35547e19201e (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
27
28
29
30
31
32
33
34
35
36
37
38
39
{-# LANGUAGE TypeFamilies, PolyKinds, NamedWildCards #-}

-- See #10982

module UnusedTyVarWarningsNamedWCs where

type family C a b where
  C a b = a                 -- should warn

type family C2 a b
type instance C2 a b = a    -- should warn

type family D a b where
  D a _b = a                -- should not warn

type family D2 a b
type instance D2 a _b = a   -- should not warn

type family E a b where
  E a _ = a                 -- should not warn

type family E2 a b
type instance E2 a _ = a    -- should not warn

type family X a b where
  X a a = Int               -- a is considered used, do not warn
  X a Int = Bool            -- here a is unused

type family Y a b c where
  Y a b b = a               -- b is used, do no warn

data family I a b c
data instance I a b c = IDC1 a | IDC2 c  -- should warn

data family J a b
data instance J a _b = JDC a  -- should not warn

data family K a b
data instance K a _ = KDC a   -- should not warn