diff options
author | Simon Marlow <marlowsd@gmail.com> | 2017-09-28 13:08:45 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2017-09-28 13:08:46 -0400 |
commit | 5935acdb1302263011c2023d5e7f4ec496c972c0 (patch) | |
tree | a9d4b99b28ae4b112b2ebef5de61e9252354e8b7 /testsuite/tests/stranal | |
parent | a10729f028d7175980d9f65e22c9bb9a933461c2 (diff) | |
download | haskell-5935acdb1302263011c2023d5e7f4ec496c972c0.tar.gz |
mkDataConRep: fix bug in strictness signature (#14290)
The strictness signature for a data con wrapper wasn't including any
dictionary arguments, which meant that bangs on the fields of a
constructor with an existential context would be moved to the wrong
fields. See T14290 for an example.
Test Plan:
* New test T14290
* validate
Reviewers: simonpj, niteria, austin, bgamari, erikd
Reviewed By: simonpj, bgamari
Subscribers: rwbarton, thomie
GHC Trac Issues: #14290
Differential Revision: https://phabricator.haskell.org/D4040
Diffstat (limited to 'testsuite/tests/stranal')
-rw-r--r-- | testsuite/tests/stranal/should_run/T14290.hs | 17 | ||||
-rw-r--r-- | testsuite/tests/stranal/should_run/all.T | 1 |
2 files changed, 18 insertions, 0 deletions
diff --git a/testsuite/tests/stranal/should_run/T14290.hs b/testsuite/tests/stranal/should_run/T14290.hs new file mode 100644 index 0000000000..7093239d4c --- /dev/null +++ b/testsuite/tests/stranal/should_run/T14290.hs @@ -0,0 +1,17 @@ +{-# LANGUAGE ExistentialQuantification #-} +module Main (main) where + +main :: IO () +main = r `seq` return () + +r :: Rec +r = Rec{ a = error "xxx", b = 3, c = True } + +class C t +instance C Bool + +data Rec = forall t. C t => Rec + { a :: () + , b :: !Int + , c :: t + } diff --git a/testsuite/tests/stranal/should_run/all.T b/testsuite/tests/stranal/should_run/all.T index 076474608e..dada8176cb 100644 --- a/testsuite/tests/stranal/should_run/all.T +++ b/testsuite/tests/stranal/should_run/all.T @@ -15,3 +15,4 @@ test('T11555a', normal, compile_and_run, ['']) test('T12368', exit_code(1), compile_and_run, ['']) test('T12368a', exit_code(1), compile_and_run, ['']) test('T13380', [expect_broken(13380), exit_code(1)], compile_and_run, ['']) +test('T14290', normal, compile_and_run, ['']) |