[commit: ghc] ghc-8.2: testsuite: Add unboxed sum to T13929 (e545f54)

git at git.haskell.org git at git.haskell.org
Wed Sep 27 03:38:21 UTC 2017


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

On branch  : ghc-8.2
Link       : http://ghc.haskell.org/trac/ghc/changeset/e545f5453a2fb46a4d9283ec6380fa63b3954adf/ghc

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

commit e545f5453a2fb46a4d9283ec6380fa63b3954adf
Author: Ben Gamari <bgamari.foss at gmail.com>
Date:   Tue Sep 19 19:09:58 2017 -0400

    testsuite: Add unboxed sum to T13929
    
    Test Plan: Validate
    
    Reviewers: austin
    
    Subscribers: rwbarton, thomie
    
    GHC Trac Issues: #13929
    
    Differential Revision: https://phabricator.haskell.org/D3993
    
    (cherry picked from commit d86b237d612bf6ca1faa61ff1130ad9144e32a52)


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

e545f5453a2fb46a4d9283ec6380fa63b3954adf
 testsuite/tests/typecheck/should_fail/T13929.hs | 5 +++++
 testsuite/tests/typecheck/should_fail/all.T     | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/testsuite/tests/typecheck/should_fail/T13929.hs b/testsuite/tests/typecheck/should_fail/T13929.hs
index f0a026d..10a7430 100644
--- a/testsuite/tests/typecheck/should_fail/T13929.hs
+++ b/testsuite/tests/typecheck/should_fail/T13929.hs
@@ -28,5 +28,10 @@ instance (GUnbox f rf, GUnbox g rg) => GUnbox (f :*: g) ('TupleRep '[rf, rg]) wh
     -- if I remove implementation of `gunbox` it compiles successfully
     gunbox (x :*: y) = (# gunbox x, gunbox y #)
 
+instance (GUnbox f rf, GUnbox g rg) => GUnbox (f :+: g) ('SumRep '[rf, rg]) where
+    type GUnboxed (f :+: g) ('SumRep '[rf, rg]) = (# GUnboxed f rf | GUnboxed g rg #)
+    gunbox (L1 l) = (# gunbox l | #)
+    gunbox (R1 r) = (# | gunbox r #)
+
 main :: IO ()
 main = pure ()
diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T
index 9f9752a..2942639 100644
--- a/testsuite/tests/typecheck/should_fail/all.T
+++ b/testsuite/tests/typecheck/should_fail/all.T
@@ -437,5 +437,5 @@ test('T13677', normal, compile_fail, [''])
 test('T11963', normal, compile_fail, [''])
 test('T14000', normal, compile_fail, [''])
 test('T11672', normal, compile_fail, [''])
-test('T13929', normal, compile_fail, [''])
+test('T13929', expect_broken(13929), compile_fail, [''])
 



More information about the ghc-commits mailing list