summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2017-09-28 13:08:45 -0400
committerBen Gamari <ben@smart-cactus.org>2017-09-28 13:08:46 -0400
commit5935acdb1302263011c2023d5e7f4ec496c972c0 (patch)
treea9d4b99b28ae4b112b2ebef5de61e9252354e8b7 /compiler
parenta10729f028d7175980d9f65e22c9bb9a933461c2 (diff)
downloadhaskell-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 'compiler')
-rw-r--r--compiler/basicTypes/MkId.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/basicTypes/MkId.hs b/compiler/basicTypes/MkId.hs
index 03ab04a24c..87e40dd62f 100644
--- a/compiler/basicTypes/MkId.hs
+++ b/compiler/basicTypes/MkId.hs
@@ -530,7 +530,11 @@ mkDataConRep dflags fam_envs wrap_name mb_bangs data_con
wrap_sig = mkClosedStrictSig wrap_arg_dmds (dataConCPR data_con)
- wrap_arg_dmds = map mk_dmd arg_ibangs
+ wrap_arg_dmds =
+ replicate (length theta) topDmd ++ map mk_dmd arg_ibangs
+ -- Don't forget the dictionary arguments when building
+ -- the strictness signature (#14290).
+
mk_dmd str | isBanged str = evalDmd
| otherwise = topDmd