Test Trac #10156
authorSimon Peyton Jones <simonpj@microsoft.com>
Mon, 16 Mar 2015 14:54:50 +0000 (14:54 +0000)
committerSimon Peyton Jones <simonpj@microsoft.com>
Mon, 16 Mar 2015 14:56:24 +0000 (14:56 +0000)
testsuite/tests/typecheck/should_compile/T10156.hs [new file with mode: 0644]
testsuite/tests/typecheck/should_compile/all.T

diff --git a/testsuite/tests/typecheck/should_compile/T10156.hs b/testsuite/tests/typecheck/should_compile/T10156.hs
new file mode 100644 (file)
index 0000000..d452122
--- /dev/null
@@ -0,0 +1,15 @@
+{-# LANGUAGE FlexibleContexts, TypeFamilies #-}
+
+module T10156 where
+
+import Data.Coerce
+
+data Iso a b = Iso (a -> b) (b -> a)
+
+coerceIso :: Coercible a b => Iso a b
+coerceIso = Iso coerce coerce
+
+type family F x
+
+f :: (Coercible a (F b), Coercible c (F b)) => a -> b -> c
+f x _ = coerce x
index 7b3fb9f..a4b497e 100644 (file)
@@ -443,3 +443,4 @@ test('T9971', normal, compile, [''])
 test('T10031', normal, compile, [''])
 test('T10072', normal, compile_fail, [''])
 test('T10100', normal, compile, [''])
+test('T10156', normal, compile, [''])