summaryrefslogtreecommitdiff
path: root/testsuite/tests/partial-sigs/should_compile/T15039a.hs
blob: 3430f14bb934d8f5f75aa94e921d213fa4d92936 (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
40
41
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE PartialTypeSignatures #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE TypeOperators #-}
{-# OPTIONS_GHC -fdefer-type-errors #-}
module T15039a where

import Data.Coerce
import Data.Kind
import Data.Type.Coercion
import Data.Type.Equality

data Dict :: Constraint -> Type where
  Dict :: c => Dict c

ex1 :: Dict ((a :: Type) ~ (b :: Type)) -> ()
ex1 (Dict :: _) = ()

ex2 :: Dict ((a :: Type) ~~ (b :: Type)) -> ()
ex2 (Dict :: _) = ()

ex3 :: Dict ((a :: Type) ~~ (b :: k)) -> ()
ex3 (Dict :: _) = ()

-- Don't know how to make GHC print an unlifted, nominal equality in an error
-- message.
--
-- ex4, ex5 :: ???

ex6 :: Dict (Coercible (a :: Type) (b :: Type)) -> ()
ex6 (Dict :: _) = ()

ex7 :: _ => Coercion (a :: Type) (b :: Type)
ex7 = Coercion

-- Don't know how to make GHC print an unlifted, heterogeneous,
-- representational equality in an error message.
--
-- ex8 :: ???