[commit: ghc] master: Coercible: Test case for now broken(?) corner case (94c5767)

git at git.haskell.org git at git.haskell.org
Tue May 20 08:53:33 UTC 2014


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/94c57676d7f88cd9edcc522aa3dc3ec6e3ad6633/ghc

>---------------------------------------------------------------

commit 94c57676d7f88cd9edcc522aa3dc3ec6e3ad6633
Author: Joachim Breitner <mail at joachim-breitner.de>
Date:   Tue May 20 10:52:14 2014 +0200

    Coercible: Test case for now broken(?) corner case
    
    involving a non-terminating newtype. This worked before 7e78faf03.
    Probably not a problem, but still better to have a test case for it. See
    ticket #9117.


>---------------------------------------------------------------

94c57676d7f88cd9edcc522aa3dc3ec6e3ad6633
 testsuite/tests/typecheck/should_compile/T9117_2.hs | 10 ++++++++++
 testsuite/tests/typecheck/should_compile/all.T      |  1 +
 2 files changed, 11 insertions(+)

diff --git a/testsuite/tests/typecheck/should_compile/T9117_2.hs b/testsuite/tests/typecheck/should_compile/T9117_2.hs
new file mode 100644
index 0000000..e7b08d8
--- /dev/null
+++ b/testsuite/tests/typecheck/should_compile/T9117_2.hs
@@ -0,0 +1,10 @@
+module T9117_2 where
+
+
+import Data.Coerce
+
+newtype Foo a = Foo (Foo a)
+newtype Age = MkAge Int
+
+ex1 :: (Foo Age) -> (Foo Int)
+ex1 = coerce
diff --git a/testsuite/tests/typecheck/should_compile/all.T b/testsuite/tests/typecheck/should_compile/all.T
index 2c3efad..07d05b8 100644
--- a/testsuite/tests/typecheck/should_compile/all.T
+++ b/testsuite/tests/typecheck/should_compile/all.T
@@ -419,3 +419,4 @@ test('T8762', normal, compile, [''])
 test('MutRec', normal, compile, [''])
 test('T8856', normal, compile, [''])
 test('T9117', normal, compile, [''])
+test('T9117_2', expect_broken('9117'), compile, [''])



More information about the ghc-commits mailing list