[Git][ghc/ghc][wip/romes/isNullaryRepDataCon] Check DataCon wrapper's LFInfo rather than its arity
Matthew Craven (@clyring)
gitlab at gitlab.haskell.org
Fri Feb 23 18:07:32 UTC 2024
Matthew Craven pushed to branch wip/romes/isNullaryRepDataCon at Glasgow Haskell Compiler / GHC
Commits:
869faa23 by Matthew Craven at 2024-02-23T13:06:06-05:00
Check DataCon wrapper's LFInfo rather than its arity
...avoid questions about whether arity 0 could ever mean "unknown"
- - - - -
1 changed file:
- compiler/GHC/StgToCmm/DataCon.hs
Changes:
=====================================
compiler/GHC/StgToCmm/DataCon.hs
=====================================
@@ -404,7 +404,9 @@ precomputedStaticConInfo_maybe cfg binder con []
| isNullaryRepDataCon con
= use_name (dataConName con)
| Just wrapper <- dataConWrapId_maybe con
- , idArity wrapper == 0 -- This might be pre-unarise arity, but that's OK
+ -- check the wrapper's LFInfo to avoid wondering whether an arity of
+ -- zero could possibly mean "unknown arity" for a DataCon wrapper
+ , Just (LFCon {}) <- idLFInfo_maybe wrapper
= use_name (varName wrapper)
where
use_name name
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/869faa23120af52ee08e49bf60e39b7e3f71cd54
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/869faa23120af52ee08e49bf60e39b7e3f71cd54
You're receiving this email because of your account on gitlab.haskell.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20240223/e690e4d2/attachment.html>
More information about the ghc-commits
mailing list