summaryrefslogtreecommitdiff
path: root/testsuite/tests/unsatisfiable/Unsatisfiable2.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/unsatisfiable/Unsatisfiable2.hs')
-rw-r--r--testsuite/tests/unsatisfiable/Unsatisfiable2.hs22
1 files changed, 22 insertions, 0 deletions
diff --git a/testsuite/tests/unsatisfiable/Unsatisfiable2.hs b/testsuite/tests/unsatisfiable/Unsatisfiable2.hs
new file mode 100644
index 0000000000..88241a7e46
--- /dev/null
+++ b/testsuite/tests/unsatisfiable/Unsatisfiable2.hs
@@ -0,0 +1,22 @@
+{-# LANGUAGE DataKinds #-}
+
+module Unsatisfiable2 where
+
+import GHC.TypeError
+import Data.Type.Bool ( If )
+import Data.Kind
+import Data.Proxy
+
+
+type ExpectTrue x = If x (() :: Constraint) (Unsatisfiable (Text "Input was False!"))
+
+h1 :: ExpectTrue x => proxy x -> ()
+h1 _ = ()
+
+h2 :: If x (() :: Constraint) (Unsatisfiable (Text "Input was False!")) => proxy x -> ()
+h2 _ = ()
+
+eg11 _ = h1 (Proxy @True)
+eg12 p = h1 p
+eg21 _ = h2 (Proxy @True)
+eg22 p = h2 p