[commit: ghc] master: testsuite: Add unboxed sum to T13929 (d86b237)
git at git.haskell.org
git at git.haskell.org
Thu Sep 21 16:10:00 UTC 2017
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/d86b237d612bf6ca1faa61ff1130ad9144e32a52/ghc
>---------------------------------------------------------------
commit d86b237d612bf6ca1faa61ff1130ad9144e32a52
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
>---------------------------------------------------------------
d86b237d612bf6ca1faa61ff1130ad9144e32a52
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 fe71e37..5079397 100644
--- a/testsuite/tests/typecheck/should_fail/all.T
+++ b/testsuite/tests/typecheck/should_fail/all.T
@@ -456,5 +456,5 @@ test('T11963', normal, compile_fail, [''])
test('T14000', normal, compile_fail, [''])
test('T14055', normal, compile_fail, [''])
test('T13909', normal, compile_fail, [''])
-test('T13929', normal, compile_fail, [''])
+test('T13929', expect_broken(13929), compile_fail, [''])
test('T14232', normal, compile_fail, [''])
More information about the ghc-commits
mailing list