diff options
Diffstat (limited to 'testsuite/tests/typecheck/should_fail/T7453.hs')
-rw-r--r-- | testsuite/tests/typecheck/should_fail/T7453.hs | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_fail/T7453.hs b/testsuite/tests/typecheck/should_fail/T7453.hs new file mode 100644 index 0000000000..b79ac9a0b9 --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T7453.hs @@ -0,0 +1,32 @@ + +module T7453 where + +newtype Id a = Id { runId :: a } + +-- cast1 :: a -> b +cast1 v = runId z + where z :: Id t + z = aux + where aux = Id v + +-- cast2 :: a -> b +cast2 v = z () + where z :: () -> t + z = aux + where aux = const v + +-- cast3 :: a -> b +cast3 v = z + where z :: t + z = v + where aux = const v + +cast1' :: a -> b +cast1' = cast1 + +cast2' :: a -> b +cast2' = cast2 + +cast3' :: a -> b +cast3' = cast3 + |