summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2015-05-19 11:48:53 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2015-05-19 11:49:15 +0100
commitfc8c5e7a516803c04f2a38b53b9e8beb2066c056 (patch)
treeeebc4bf4fd08bded1cba09be49a8d7e135b9d6cf
parent753b156dc6b0c38b106c390952750fb800bf27e7 (diff)
downloadhaskell-fc8c5e7a516803c04f2a38b53b9e8beb2066c056.tar.gz
Test Trac #8799, #8555
-rw-r--r--testsuite/tests/typecheck/should_compile/T8555.hs7
-rw-r--r--testsuite/tests/typecheck/should_compile/T8799.hs10
-rw-r--r--testsuite/tests/typecheck/should_compile/all.T2
3 files changed, 19 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_compile/T8555.hs b/testsuite/tests/typecheck/should_compile/T8555.hs
new file mode 100644
index 0000000000..c5e817b467
--- /dev/null
+++ b/testsuite/tests/typecheck/should_compile/T8555.hs
@@ -0,0 +1,7 @@
+{-# LANGUAGE FlexibleContexts #-}
+
+module T8555 where
+import Data.Coerce
+
+foo :: Coercible [a] [b] => a -> b
+foo = coerce
diff --git a/testsuite/tests/typecheck/should_compile/T8799.hs b/testsuite/tests/typecheck/should_compile/T8799.hs
new file mode 100644
index 0000000000..f5a92d4204
--- /dev/null
+++ b/testsuite/tests/typecheck/should_compile/T8799.hs
@@ -0,0 +1,10 @@
+{-# LANGUAGE FlexibleContexts #-}
+
+module T8555 where
+import Data.Coerce
+
+foo :: Coercible a b => b -> a
+foo = coerce
+
+bar :: (Coercible a b, Coercible b c) => b -> c -> a
+bar b c = coerce c
diff --git a/testsuite/tests/typecheck/should_compile/all.T b/testsuite/tests/typecheck/should_compile/all.T
index 562acba378..2f257eafee 100644
--- a/testsuite/tests/typecheck/should_compile/all.T
+++ b/testsuite/tests/typecheck/should_compile/all.T
@@ -454,3 +454,5 @@ test('T10335', normal, compile, [''])
test('Improvement', normal, compile, [''])
test('T10009', normal, compile, [''])
test('T10390', normal, compile, [''])
+test('T8555', normal, compile, [''])
+test('T8799', normal, compile, [''])