diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2015-03-16 14:54:50 +0000 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2015-03-16 14:56:24 +0000 |
commit | 817d2c3436a99d998c79c5f9755c03aa21ced32c (patch) | |
tree | 9e7746c7dd494939fbe9bb9bfc7c8905ef578e9b | |
parent | e935a7f4584f02e67196bb1f1978b32f0fdb310c (diff) | |
download | haskell-817d2c3436a99d998c79c5f9755c03aa21ced32c.tar.gz |
Test Trac #10156
-rw-r--r-- | testsuite/tests/typecheck/should_compile/T10156.hs | 15 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_compile/all.T | 1 |
2 files changed, 16 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_compile/T10156.hs b/testsuite/tests/typecheck/should_compile/T10156.hs new file mode 100644 index 0000000000..d452122109 --- /dev/null +++ b/testsuite/tests/typecheck/should_compile/T10156.hs @@ -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 diff --git a/testsuite/tests/typecheck/should_compile/all.T b/testsuite/tests/typecheck/should_compile/all.T index 7b3fb9f981..a4b497e993 100644 --- a/testsuite/tests/typecheck/should_compile/all.T +++ b/testsuite/tests/typecheck/should_compile/all.T @@ -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, ['']) |