summaryrefslogtreecommitdiff
path: root/testsuite/tests/rename/should_compile/T19984.hs
blob: 355fcdda64b7e84477159adadc171cff8b2b11f6 (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
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeOperators #-}

module T19984 where

data D a = (:-) a a

-- promoted datacons missing promotion tick
-- (should give warnings with -fwarn-unticked-promoted-constructors)
type A1 = Int : '[]
type B1 = [Int, Bool]
type C1 = (:) Int '[]
type E1 = Int :- Bool
type F1 = (:-) Int Bool

-- promoted datacons with promotion ticks
-- (no warnings)
type A2 = Int ': '[]
type B2 = '[Int, Bool]
type C2 = '(:) Int '[]
type E2 = Int ':- Bool
type F2 = '(:-) Int Bool

-- non-promoted datacons
-- (no warnings)
data G = GA | GB
a3, b3, c3 :: [G]
a3 = GA : []
b3 = [GA, GB]
c3 = (:) GA []

e3, f3 :: D G
e3 = GA :- GB
f3 = (:-) GA GB