[Git][ghc/ghc][wip/romes/template-haskell-quote-strictness] fix: Consider strictness annotation in rep_bind
Rodrigo Mesquita (@alt-romes)
gitlab at gitlab.haskell.org
Tue Feb 28 15:59:12 UTC 2023
Rodrigo Mesquita pushed to branch wip/romes/template-haskell-quote-strictness at Glasgow Haskell Compiler / GHC
Commits:
0856201a by romes at 2023-02-28T15:59:03+00:00
fix: Consider strictness annotation in rep_bind
Fixes #23036
- - - - -
1 changed file:
- compiler/GHC/HsToCore/Quote.hs
Changes:
=====================================
compiler/GHC/HsToCore/Quote.hs
=====================================
@@ -1899,12 +1899,18 @@ rep_bind (L loc (FunBind
fun_matches = MG { mg_alts
= (L _ [L _ (Match
{ m_pats = []
- , m_grhss = GRHSs _ guards wheres }
- )]) } }))
+ , m_grhss = GRHSs _ guards wheres
+ -- For a variable declaration I'm pretty
+ -- sure we always have a FunRhs
+ , m_ctxt = FunRhs { mc_strictness = strictessAnn }
+ } )]) } }))
= do { (ss,wherecore) <- repBinds wheres
; guardcore <- addBinds ss (repGuards guards)
; fn' <- lookupNBinder fn
- ; p <- repPvar fn'
+ ; p <- repPvar fn' >>= case strictessAnn of
+ SrcLazy -> repPtilde
+ SrcStrict -> repPbang
+ NoSrcStrict -> pure
; ans <- repVal p guardcore wherecore
; ans' <- wrapGenSyms ss ans
; return (locA loc, ans') }
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/0856201ab9e6f3b24d1386012bb4708dbd7854f7
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/0856201ab9e6f3b24d1386012bb4708dbd7854f7
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/20230228/8a5c15bf/attachment-0001.html>
More information about the ghc-commits
mailing list