[commit: ghc] ghc-7.8: Add test case for #8743 (2920547)

git at git.haskell.org git at git.haskell.org
Mon Feb 17 09:14:53 UTC 2014


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

On branch  : ghc-7.8
Link       : http://ghc.haskell.org/trac/ghc/changeset/29205476afba5e2f72e233ede981055283a52d65/ghc

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

commit 29205476afba5e2f72e233ede981055283a52d65
Author: Joachim Breitner <mail at joachim-breitner.de>
Date:   Fri Feb 7 17:56:18 2014 +0000

    Add test case for #8743
    
    which only occurs when the instance being compiled is also present from
    a .hs-boot file.
    
    (cherry picked from commit c3ff5f29c80680a09c7779aee2535fa64b880cd9)


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

29205476afba5e2f72e233ede981055283a52d65
 testsuite/tests/stranal/should_compile/T8743.hs      |   11 +++++++++++
 testsuite/tests/stranal/should_compile/T8743.hs-boot |    3 +++
 testsuite/tests/stranal/should_compile/all.T         |    2 ++
 3 files changed, 16 insertions(+)

diff --git a/testsuite/tests/stranal/should_compile/T8743.hs b/testsuite/tests/stranal/should_compile/T8743.hs
new file mode 100644
index 0000000..a69e522
--- /dev/null
+++ b/testsuite/tests/stranal/should_compile/T8743.hs
@@ -0,0 +1,11 @@
+module T8743 where
+
+-- Without the following import, it does not fail
+import {-# SOURCE #-} T8743 ()
+
+-- [()] required, () does not work.
+class ToRow a where toRow :: a -> [()]
+
+instance ToRow (Maybe a) where
+    toRow Nothing  = [()]
+    toRow (Just _) = [()]
diff --git a/testsuite/tests/stranal/should_compile/T8743.hs-boot b/testsuite/tests/stranal/should_compile/T8743.hs-boot
new file mode 100644
index 0000000..7f22b24
--- /dev/null
+++ b/testsuite/tests/stranal/should_compile/T8743.hs-boot
@@ -0,0 +1,3 @@
+module T8743 where
+class ToRow a
+instance ToRow (Maybe a)
diff --git a/testsuite/tests/stranal/should_compile/all.T b/testsuite/tests/stranal/should_compile/all.T
index 7ee45ad..2c53ebb 100644
--- a/testsuite/tests/stranal/should_compile/all.T
+++ b/testsuite/tests/stranal/should_compile/all.T
@@ -18,3 +18,5 @@ test('newtype', req_profiling, compile, ['-prof -auto-all'])
 test('T1988', normal, compile, [''])
 test('T8467', normal, compile, [''])
 test('T8037', normal, compile, [''])
+test('T8743', [ expect_broken(8743), extra_clean(['T8743.o-boot', 'T8743.hi-boot']) ], multimod_compile, ['T8743', '-v0'])
+



More information about the ghc-commits mailing list