Apoorv Ingle pushed to branch wip/ani/T27156 at Glasgow Haskell Compiler / GHC
Commits:
-
0ebd3306
by Apoorv Ingle at 2026-04-21T19:43:24-05:00
3 changed files:
Changes:
| ... | ... | @@ -44,8 +44,6 @@ import GHC.Tc.Types.Evidence |
| 44 | 44 | import GHC.Tc.Types.ErrCtxt
|
| 45 | 45 | import GHC.Tc.TyCl ( IsPrefixConGADT(..), unannotatedMultIsLinear )
|
| 46 | 46 | |
| 47 | -import GHC.Tc.Gen.Expand ( tcExpandNoTcM )
|
|
| 48 | - |
|
| 49 | 47 | import GHC.Core.Class
|
| 50 | 48 | import GHC.Core.DataCon
|
| 51 | 49 | import GHC.Core.TyCon
|
| ... | ... | @@ -1620,13 +1618,11 @@ repE (HsCase _ e (MG { mg_alts = (L _ ms) })) |
| 1620 | 1618 | ; ms2 <- mapM repMatchTup ms
|
| 1621 | 1619 | ; core_ms2 <- coreListM matchTyConName ms2
|
| 1622 | 1620 | ; repCaseE arg core_ms2 }
|
| 1623 | -repE e@(HsIf _ x y z) = case (tcExpandNoTcM e) of
|
|
| 1624 | - Nothing -> do { a <- repLE x
|
|
| 1625 | - ; b <- repLE y
|
|
| 1626 | - ; c <- repLE z
|
|
| 1627 | - ; repCond a b c }
|
|
| 1628 | - Just (HSE _ (L _ e')) -> repE e'
|
|
| 1629 | - |
|
| 1621 | +repE (HsIf _ x y z) = do
|
|
| 1622 | + a <- repLE x
|
|
| 1623 | + b <- repLE y
|
|
| 1624 | + c <- repLE z
|
|
| 1625 | + repCond a b c
|
|
| 1630 | 1626 | repE (HsMultiIf _ alts)
|
| 1631 | 1627 | = do { (binds, alts') <- NE.unzip <$> mapM repLGRHS alts
|
| 1632 | 1628 | ; expr' <- repMultiIf (nonEmptyCoreList' alts')
|
| ... | ... | @@ -554,7 +554,7 @@ rnExpr (RecordUpd { rupd_expr = L l expr, rupd_flds = rbinds }) |
| 554 | 554 | ; let upd_flds = OverloadedRecUpdFields
|
| 555 | 555 | { xOLRecUpdFields = noExtField
|
| 556 | 556 | , olRecUpdFields = us }
|
| 557 | - rs_table = Rebindable [(nameOccName getField, getField) , (nameOccName getField, setField)]
|
|
| 557 | + rs_table = Rebindable [(nameOccName getField, getField) , (nameOccName setField, setField)]
|
|
| 558 | 558 | ; return (RecordUpd rs_table (L l e) upd_flds
|
| 559 | 559 | , plusFNs [fv_getField, fv_setField, fv_e, fv_us] )
|
| 560 | 560 | }
|
| ... | ... | @@ -24,6 +24,7 @@ import GHC.Hs |
| 24 | 24 | import GHC.Types.Name.Reader
|
| 25 | 25 | import GHC.Tc.Errors.Types
|
| 26 | 26 | import GHC.Tc.Utils.Monad
|
| 27 | +import GHC.Tc.Gen.Expand
|
|
| 27 | 28 | import GHC.Driver.Env.Types
|
| 28 | 29 | |
| 29 | 30 | import GHC.Rename.Env
|
| ... | ... | @@ -141,9 +142,12 @@ rnTypedBracket e br_body |
| 141 | 142 | ; recordThUse
|
| 142 | 143 | |
| 143 | 144 | ; traceRn "Renaming typed TH bracket" empty
|
| 144 | - ; (body', fvs_e) <- setThLevel (Brack cur_level RnPendingTyped) $ rnLExpr br_body
|
|
| 145 | - ; return (HsTypedBracket noExtField body', fvs_e)
|
|
| 146 | - |
|
| 145 | + ; (body'@(L loc b) , fvs_e) <- setThLevel (Brack cur_level RnPendingTyped) $ rnLExpr br_body
|
|
| 146 | + -- ; return (HsTypedBracket noExtField body', fvs_e)
|
|
| 147 | + ; mb_b <- tcExpand b
|
|
| 148 | + ; case mb_b of
|
|
| 149 | + Nothing -> return (HsTypedBracket noExtField body', fvs_e)
|
|
| 150 | + Just hse -> return (HsTypedBracket noExtField (L loc (XExpr (ExpandedThingRn hse))), fvs_e)
|
|
| 147 | 151 | }
|
| 148 | 152 | |
| 149 | 153 | rnUntypedBracket :: HsExpr GhcPs -> HsQuote GhcPs -> RnM (HsExpr GhcRn, FreeNames)
|
| ... | ... | @@ -176,6 +180,7 @@ rnUntypedBracket e br_body |
| 176 | 180 | setThLevel (UntypedBrack cur_level ps_var) $
|
| 177 | 181 | rn_utbracket br_body
|
| 178 | 182 | ; pendings <- readMutVar ps_var
|
| 183 | + |
|
| 179 | 184 | ; return (HsUntypedBracket pendings body', fvs_e)
|
| 180 | 185 | |
| 181 | 186 | }
|