summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2020-02-24 09:03:08 +0000
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-03-10 12:31:15 -0400
commit7b2c827b7b68f0ade7f4ae66e7033fdb84d75a5f (patch)
tree2d3a26c4d5099af19c08411f2b3a84a5a2e90ab9
parent5ba01d83a2078acce789a9d5f111efa4d4ffc616 (diff)
downloadhaskell-7b2c827b7b68f0ade7f4ae66e7033fdb84d75a5f.tar.gz
Comments only
Clarify code added in #17852 and MR !2724
-rw-r--r--compiler/stranal/WwLib.hs6
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/stranal/WwLib.hs b/compiler/stranal/WwLib.hs
index 5d4325766b..49e8a7f70b 100644
--- a/compiler/stranal/WwLib.hs
+++ b/compiler/stranal/WwLib.hs
@@ -1179,8 +1179,14 @@ mk_absent_let dflags fam_envs arg
-- (for the sake of the "empty case scrutinee not known to
-- diverge for sure lint" warning)
arg_ty = idType arg
+
+ -- Normalise the type to have best chance of finding an absent literal
+ -- e.g. (#17852) data unlifted N = MkN Int#
+ -- f :: N -> a -> a
+ -- f _ x = x
(co, nty) = topNormaliseType_maybe fam_envs arg_ty
`orElse` (mkRepReflCo arg_ty, arg_ty)
+
abs_rhs = mkAbsentErrorApp arg_ty msg
msg = showSDoc (gopt_set dflags Opt_SuppressUniques)
(ppr arg <+> ppr (idType arg))