Commit c5b477c2 authored by Ömer Sinan Ağacan's avatar Ömer Sinan Ağacan Committed by Ben Gamari

Fix cardinality change of fields in addDataConStrictness

Test Plan: This validates

Reviewers: simonpj, bgamari

Reviewed By: bgamari

Subscribers: rwbarton, carter

Differential Revision: https://phabricator.haskell.org/D5225
parent 26e81e90
......@@ -56,7 +56,7 @@ module Demand (
useCount, isUsedOnce, reuseEnv,
killUsageDemand, killUsageSig, zapUsageDemand, zapUsageEnvSig,
zapUsedOnceDemand, zapUsedOnceSig,
strictifyDictDmd
strictifyDictDmd, strictifyDmd
) where
......@@ -2033,6 +2033,10 @@ strictifyDictDmd ty dmd = case getUseDmd dmd of
-- the superclass dicts are always a prefix
_ -> dmd -- unused or not a dictionary
strictifyDmd :: Demand -> Demand
strictifyDmd dmd@(JD { sd = str })
= dmd { sd = str `bothArgStr` Str VanStr HeadStr }
{-
Note [HyperStr and Use demands]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
......
......@@ -1222,7 +1222,7 @@ addDataConStrictness con ds
where
strs = dataConRepStrictness con
add dmd str | isMarkedStrict str
, not (isAbsDmd dmd) = dmd `bothDmd` seqDmd
, not (isAbsDmd dmd) = strictifyDmd dmd
| otherwise = dmd
findBndrsDmds :: AnalEnv -> DmdType -> [Var] -> (DmdType, [Demand])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment