diff options
Diffstat (limited to 'testsuite/tests/typecheck/should_compile/T15431.hs')
-rw-r--r-- | testsuite/tests/typecheck/should_compile/T15431.hs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_compile/T15431.hs b/testsuite/tests/typecheck/should_compile/T15431.hs new file mode 100644 index 0000000000..21fa4c4e38 --- /dev/null +++ b/testsuite/tests/typecheck/should_compile/T15431.hs @@ -0,0 +1,15 @@ +{-# LANGUAGE GADTs, FlexibleContexts #-} + +module T15431 where + +import Data.Coerce + +data T t where + A :: Show (t a) => t a -> T t + B :: Coercible Int (t a) => t a -> T t + +f :: T t -> String +f (A t) = show t + +g :: T t -> Int +g (B t) = coerce t |