diff options
-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, ['']) |