[Git][ghc/ghc][wip/spj-apporv-Oct24] Pass HsThingRn as an argument to splitHsApps for fixing the right AppCtx for...

Apoorv Ingle (@ani) gitlab at gitlab.haskell.org
Mon Feb 10 02:42:17 UTC 2025



Apoorv Ingle pushed to branch wip/spj-apporv-Oct24 at Glasgow Haskell Compiler / GHC


Commits:
1d2aeaa1 by Apoorv Ingle at 2025-02-09T20:41:30-06:00
Pass HsThingRn as an argument to splitHsApps for fixing the right AppCtx for arguments in application chain of an expanded expression

- - - - -


5 changed files:

- compiler/GHC/Tc/Gen/Do.hs
- compiler/GHC/Tc/Gen/Expr.hs
- compiler/GHC/Tc/Gen/Expr.hs-boot
- compiler/GHC/Tc/Gen/Head.hs
- compiler/GHC/Tc/Gen/Match.hs


Changes:

=====================================
compiler/GHC/Tc/Gen/Do.hs
=====================================
@@ -79,7 +79,6 @@ expand_do_stmts flav [stmt@(L _loc (LastStmt _ (L body_loc body) _ ret_expr))]
    | NoSyntaxExprRn <- ret_expr
    -- Last statement is just body if we are not in ListComp context. See Syntax.Expr.LastStmt
    = return $ mkExpandedStmt stmt flav body
-
    | SyntaxExprRn ret <- ret_expr
    --
    --    ------------------------------------------------
@@ -92,7 +91,7 @@ expand_do_stmts doFlavour (stmt@(L _ (LetStmt _ bs)) : lstmts) =
 -- See  Note [Expanding HsDo with XXExprGhcRn] Equation (3) below
 --                      stmts ~~> stmts'
 --    ------------------------------------------------
---       let x = e ; stmts ~~> let x = e in stmts'xo
+--       let x = e ; stmts ~~> let x = e in stmts'
   do expand_stmts_expr <- expand_do_stmts doFlavour lstmts
      let expansion = genHsLet bs (genPopErrCtxtExpr expand_stmts_expr)
      return $ mkExpandedStmt stmt doFlavour expansion


=====================================
compiler/GHC/Tc/Gen/Expr.hs
=====================================
@@ -129,7 +129,7 @@ tcPolyLExprNC (L loc expr) res_ty
 
 -----------------
 tcPolyExpr :: HsExpr GhcRn -> ExpSigmaType -> TcM (HsExpr GhcTc)
-tcPolyExpr e (Infer inf) = tcExpr e (Infer inf)
+tcPolyExpr e (Infer inf) = tcExpr Nothing e (Infer inf)
 tcPolyExpr e (Check ty)  = tcPolyExprCheck e (Left ty)
 
 -----------------
@@ -186,7 +186,7 @@ tcPolyExprCheck expr res_ty
       -- before handing off to tcExpr
       tc_body e = do { ds_flag <- getDeepSubsumptionFlag
                      ; inner_skolemise ds_flag rho_ty $ \rho_ty' ->
-                       tcExpr e (mkCheckExpType rho_ty') }
+                       tcExpr Nothing e (mkCheckExpType rho_ty') }
     in tc_body expr
   where
     -- `outer_skolemise` is used always
@@ -231,12 +231,12 @@ tcInferRho, tcInferRhoNC :: LHsExpr GhcRn -> TcM (LHsExpr GhcTc, TcRhoType)
 tcInferRho (L loc expr)
   = setSrcSpanA loc   $  -- Set location /first/; see GHC.Tc.Utils.Monad
     addExprCtxt expr $  -- Note [Error contexts in generated code]
-    do { (expr', rho) <- tcInfer (tcExpr expr)
+    do { (expr', rho) <- tcInfer (tcExpr Nothing expr)
        ; return (L loc expr', rho) }
 
 tcInferRhoNC (L loc expr)
   = setSrcSpanA loc $
-    do { (expr', rho) <- tcInfer (tcExpr expr)
+    do { (expr', rho) <- tcInfer (tcExpr Nothing expr)
        ; return (L loc expr', rho) }
 
 ---------------
@@ -258,16 +258,17 @@ tcMonoExpr, tcMonoExprNC
 tcMonoExpr (L loc expr) res_ty
   = setSrcSpanA loc   $  -- Set location /first/; see GHC.Tc.Utils.Monad
     addExprCtxt expr $  -- Note [Error contexts in generated code]
-    do  { expr' <- tcExpr expr res_ty
+    do  { expr' <- tcExpr Nothing expr res_ty
         ; return (L loc expr') }
 
 tcMonoExprNC (L loc expr) res_ty
   = setSrcSpanA loc $
-    do  { expr' <- tcExpr expr res_ty
+    do  { expr' <- tcExpr Nothing expr res_ty
         ; return (L loc expr') }
 
 ---------------
-tcExpr :: HsExpr GhcRn
+tcExpr :: Maybe HsThingRn
+       -> HsExpr GhcRn
        -> ExpRhoType   -- DeepSubsumption <=> when checking, this type
                        --                     is deeply skolemised
        -> TcM (HsExpr GhcTc)
@@ -288,45 +289,45 @@ tcExpr :: HsExpr GhcRn
 --   - ones taken apart by GHC.Tc.Gen.Head.splitHsApps
 --   - ones understood by GHC.Tc.Gen.Head.tcInferAppHead_maybe
 -- See Note [Application chains and heads] in GHC.Tc.Gen.App
-tcExpr e@(HsVar {})              res_ty = tcApp Nothing e res_ty
-tcExpr e@(HsApp {})              res_ty = tcApp Nothing e res_ty
-tcExpr e@(OpApp {})              res_ty = tcApp Nothing e res_ty
-tcExpr e@(HsAppType {})          res_ty = tcApp Nothing e res_ty
-tcExpr e@(ExprWithTySig {})      res_ty = tcApp Nothing e res_ty
+tcExpr xern e@(HsVar {})              res_ty = tcApp xern e res_ty
+tcExpr xern e@(HsApp {})              res_ty = tcApp xern e res_ty
+tcExpr xern e@(OpApp {})              res_ty = tcApp xern e res_ty
+tcExpr xern e@(HsAppType {})          res_ty = tcApp xern e res_ty
+tcExpr xern e@(ExprWithTySig {})      res_ty = tcApp xern e res_ty
 
-tcExpr (XExpr e)                 res_ty = tcXExpr e res_ty
+tcExpr _ (XExpr e)                    res_ty = tcXExpr e res_ty
 
 -- Typecheck an occurrence of an unbound Id
 --
 -- Some of these started life as a true expression hole "_".
 -- Others might simply be variables that accidentally have no binding site
-tcExpr (HsUnboundVar _ occ) res_ty
+tcExpr _ (HsUnboundVar _ occ) res_ty
   = do { ty <- expTypeToType res_ty    -- Allow Int# etc (#12531)
        ; her <- emitNewExprHole occ ty
        ; tcEmitBindingUsage bottomUE   -- Holes fit any usage environment
                                        -- (#18491)
        ; return (HsUnboundVar her occ) }
 
-tcExpr e@(HsLit x lit) res_ty
+tcExpr _ e@(HsLit x lit) res_ty
   = do { let lit_ty = hsLitType lit
        ; tcWrapResult e (HsLit x (convertLit lit)) lit_ty res_ty }
 
-tcExpr (HsPar x expr) res_ty
+tcExpr _ (HsPar x expr) res_ty
   = do { expr' <- tcMonoExprNC expr res_ty
        ; return (HsPar x expr') }
 
-tcExpr (HsPragE x prag expr) res_ty
+tcExpr _ (HsPragE x prag expr) res_ty
   = do { expr' <- tcMonoExpr expr res_ty
        ; return (HsPragE x (tcExprPrag prag) expr') }
 
-tcExpr (NegApp x expr neg_expr) res_ty
+tcExpr _ (NegApp x expr neg_expr) res_ty
   = do  { (expr', neg_expr')
             <- tcSyntaxOp NegateOrigin neg_expr [SynAny] res_ty $
                \[arg_ty] [arg_mult] ->
                tcScalingUsage arg_mult $ tcCheckMonoExpr expr arg_ty
         ; return (NegApp x expr' neg_expr') }
 
-tcExpr e@(HsIPVar _ x) res_ty
+tcExpr _ e@(HsIPVar _ x) res_ty
   = do { ip_ty <- newFlexiTyVarTy liftedTypeKind
           -- Create a unification type variable of kind 'Type'.
           -- (The type of an implicit parameter must have kind 'Type'.)
@@ -342,7 +343,7 @@ tcExpr e@(HsIPVar _ x) res_ty
                           unwrapIP $ mkClassPred ipClass [x,ty]
   origin = IPOccOrigin x
 
-tcExpr e@(HsLam x lam_variant matches) res_ty
+tcExpr _ e@(HsLam x lam_variant matches) res_ty
   = do { (wrap, matches') <- tcLambdaMatches e lam_variant matches [] res_ty
        ; return (mkHsWrap wrap $ HsLam x lam_variant matches') }
 
@@ -354,7 +355,7 @@ tcExpr e@(HsLam x lam_variant matches) res_ty
 ************************************************************************
 -}
 
-tcExpr e@(HsOverLit _ lit) res_ty
+tcExpr _ e@(HsOverLit _ lit) res_ty
   = -- See Note [Typechecking overloaded literals]
     do { mb_res <- tcShortCutLit lit res_ty
          -- See Note [Short cut for overloaded literals] in GHC.Tc.Utils.TcMType
@@ -403,14 +404,14 @@ tricky:
 -- The expansion includes an ExplicitList, but it is always the built-in
 -- list type, so that's all we need concern ourselves with here.  See
 -- GHC.Rename.Expr. Note [Handling overloaded and rebindable constructs]
-tcExpr (ExplicitList _ exprs) res_ty
+tcExpr _ (ExplicitList _ exprs) res_ty
   = do  { res_ty <- expTypeToType res_ty
         ; (coi, elt_ty) <- matchExpectedListTy res_ty
         ; let tc_elt expr = tcCheckPolyExpr expr elt_ty
         ; exprs' <- mapM tc_elt exprs
         ; return $ mkHsWrapCo coi $ ExplicitList elt_ty exprs' }
 
-tcExpr expr@(ExplicitTuple x tup_args boxity) res_ty
+tcExpr _ expr@(ExplicitTuple x tup_args boxity) res_ty
   | all tupArgPresent tup_args
   = do { let arity  = length tup_args
              tup_tc = tupleTyCon boxity arity
@@ -441,7 +442,7 @@ tcExpr expr@(ExplicitTuple x tup_args boxity) res_ty
 
        ; tcWrapResultMono expr expr' act_res_ty res_ty }
 
-tcExpr (ExplicitSum _ alt arity expr) res_ty
+tcExpr _ (ExplicitSum _ alt arity expr) res_ty
   = do { let sum_tc = sumTyCon arity
        ; res_ty <- expTypeToType res_ty
        ; (coi, arg_tys) <- matchExpectedTyConApp sum_tc res_ty
@@ -468,12 +469,12 @@ tcExpr (ExplicitSum _ alt arity expr) res_ty
 ************************************************************************
 -}
 
-tcExpr (HsLet x binds expr) res_ty
+tcExpr _ (HsLet x binds expr) res_ty
   = do  { (binds', expr') <- tcLocalBinds binds $
                              tcMonoExpr expr res_ty
         ; return (HsLet x binds' expr') }
 
-tcExpr (HsCase ctxt scrut matches) res_ty
+tcExpr _ (HsCase ctxt scrut matches) res_ty
   = do  {  -- We used to typecheck the case alternatives first.
            -- The case patterns tend to give good type info to use
            -- when typechecking the scrutinee.  For example
@@ -497,7 +498,7 @@ tcExpr (HsCase ctxt scrut matches) res_ty
         ; matches' <- tcCaseMatches tcBody (Scaled mult scrut_ty) matches res_ty
         ; return (HsCase ctxt scrut' matches') }
 
-tcExpr (HsIf x pred b1 b2) res_ty
+tcExpr _ (HsIf x pred b1 b2) res_ty
   = do { pred'    <- tcCheckMonoExpr pred boolTy
        ; (u1,b1') <- tcCollectingUsage $ tcMonoExpr b1 res_ty
        ; (u2,b2') <- tcCollectingUsage $ tcMonoExpr b2 res_ty
@@ -528,16 +529,16 @@ If we add linear guards, this code will have to be revisited.
 Not using 'sup' caused #23814.
 -}
 
-tcExpr (HsMultiIf _ alts) res_ty
+tcExpr _ (HsMultiIf _ alts) res_ty
   = do { alts' <- tcGRHSList IfAlt tcBody alts res_ty
                   -- See Note [MultiWayIf linearity checking]
        ; res_ty <- readExpType res_ty
        ; return (HsMultiIf res_ty alts') }
 
-tcExpr (HsDo _ do_or_lc stmts) res_ty
+tcExpr _ (HsDo _ do_or_lc stmts) res_ty
   = tcDoStmts do_or_lc stmts res_ty
 
-tcExpr (HsProc x pat cmd) res_ty
+tcExpr _ (HsProc x pat cmd) res_ty
   = do  { (pat', cmd', coi) <- tcProc pat cmd res_ty
         ; return $ mkHsWrapCo coi (HsProc x pat' cmd') }
 
@@ -549,7 +550,7 @@ tcExpr (HsProc x pat cmd) res_ty
 -- and wrap (static e) in a call to
 --    fromStaticPtr :: IsStatic p => StaticPtr a -> p a
 
-tcExpr (HsStatic fvs expr) res_ty
+tcExpr _ (HsStatic fvs expr) res_ty
   = do  { res_ty          <- expTypeToType res_ty
         ; (co, (p_ty, expr_ty)) <- matchExpectedAppTy res_ty
         ; (expr', lie)    <- captureConstraints $
@@ -586,10 +587,10 @@ tcExpr (HsStatic fvs expr) res_ty
                             (L (noAnnSrcSpan loc) (HsStatic (fvs, mkTyConApp static_ptr_ty_con [expr_ty]) expr'))
         }
 
-tcExpr (HsEmbTy _ _)      _ = failWith (TcRnIllegalTypeExpr TypeKeywordSyntax)
-tcExpr (HsQual _ _ _)     _ = failWith (TcRnIllegalTypeExpr ContextArrowSyntax)
-tcExpr (HsForAll _ _ _)   _ = failWith (TcRnIllegalTypeExpr ForallTelescopeSyntax)
-tcExpr (HsFunArr _ _ _ _) _ = failWith (TcRnIllegalTypeExpr FunctionArrowSyntax)
+tcExpr _ (HsEmbTy _ _)      _ = failWith (TcRnIllegalTypeExpr TypeKeywordSyntax)
+tcExpr _ (HsQual _ _ _)     _ = failWith (TcRnIllegalTypeExpr ContextArrowSyntax)
+tcExpr _ (HsForAll _ _ _)   _ = failWith (TcRnIllegalTypeExpr ForallTelescopeSyntax)
+tcExpr _ (HsFunArr _ _ _ _) _ = failWith (TcRnIllegalTypeExpr FunctionArrowSyntax)
 
 {-
 ************************************************************************
@@ -599,7 +600,7 @@ tcExpr (HsFunArr _ _ _ _) _ = failWith (TcRnIllegalTypeExpr FunctionArrowSyntax)
 ************************************************************************
 -}
 
-tcExpr expr@(RecordCon { rcon_con = L loc con_name
+tcExpr _ expr@(RecordCon { rcon_con = L loc con_name
                        , rcon_flds = rbinds }) res_ty
   = do  { con_like <- tcLookupConLike con_name
 
@@ -640,7 +641,7 @@ tcExpr expr@(RecordCon { rcon_con = L loc con_name
 -- in the renamer. See Note [Overview of record dot syntax] in
 -- GHC.Hs.Expr. This is why we match on 'rupd_flds = Left rbnds' here
 -- and panic otherwise.
-tcExpr expr@(RecordUpd { rupd_expr = record_expr
+tcExpr _ expr@(RecordUpd { rupd_expr = record_expr
                        , rupd_flds =
                            RegularRecUpdFields
                              { xRecUpdFields = possible_parents
@@ -654,7 +655,7 @@ tcExpr expr@(RecordUpd { rupd_expr = record_expr
 
           -- Typecheck the expanded expression.
         ; expr' <- addErrCtxt err_ctxt $
-                   tcExpr (mkExpandedExpr expr ds_expr) (Check ds_res_ty)
+                   tcExpr Nothing (mkExpandedExpr expr ds_expr) (Check ds_res_ty)
             -- NB: it's important to use ds_res_ty and not res_ty here.
             -- Test case: T18802b.
 
@@ -666,7 +667,7 @@ tcExpr expr@(RecordUpd { rupd_expr = record_expr
             -- Test case: T10808.
         }
 
-tcExpr e@(RecordUpd { rupd_flds = OverloadedRecUpdFields {}}) _
+tcExpr _ e@(RecordUpd { rupd_flds = OverloadedRecUpdFields {}}) _
   = pprPanic "tcExpr: unexpected overloaded-dot RecordUpd" $ ppr e
 
 {-
@@ -679,7 +680,7 @@ tcExpr e@(RecordUpd { rupd_flds = OverloadedRecUpdFields {}}) _
 ************************************************************************
 -}
 
-tcExpr (ArithSeq _ witness seq) res_ty
+tcExpr _ (ArithSeq _ witness seq) res_ty
   = tcArithSeq witness seq res_ty
 
 {-
@@ -692,8 +693,8 @@ tcExpr (ArithSeq _ witness seq) res_ty
 
 -- These terms have been replaced by their expanded expressions in the renamer. See
 -- Note [Overview of record dot syntax].
-tcExpr (HsGetField _ _ _) _ = panic "GHC.Tc.Gen.Expr: tcExpr: HsGetField: Not implemented"
-tcExpr (HsProjection _ _) _ = panic "GHC.Tc.Gen.Expr: tcExpr: HsProjection: Not implemented"
+tcExpr _ (HsGetField _ _ _) _ = panic "GHC.Tc.Gen.Expr: tcExpr: HsGetField: Not implemented"
+tcExpr _ (HsProjection _ _) _ = panic "GHC.Tc.Gen.Expr: tcExpr: HsProjection: Not implemented"
 
 {-
 ************************************************************************
@@ -705,11 +706,11 @@ tcExpr (HsProjection _ _) _ = panic "GHC.Tc.Gen.Expr: tcExpr: HsProjection: Not
 
 -- Here we get rid of it and add the finalizers to the global environment.
 -- See Note [Delaying modFinalizers in untyped splices] in GHC.Rename.Splice.
-tcExpr (HsTypedSplice ext splice)   res_ty = tcTypedSplice ext splice res_ty
-tcExpr e@(HsTypedBracket _ body)    res_ty = tcTypedBracket e body res_ty
+tcExpr _ (HsTypedSplice ext splice)   res_ty = tcTypedSplice ext splice res_ty
+tcExpr _ e@(HsTypedBracket _ body)    res_ty = tcTypedBracket e body res_ty
 
-tcExpr e@(HsUntypedBracket ps body) res_ty = tcUntypedBracket e body ps res_ty
-tcExpr (HsUntypedSplice splice _)   res_ty
+tcExpr _ e@(HsUntypedBracket ps body) res_ty = tcUntypedBracket e body ps res_ty
+tcExpr _ (HsUntypedSplice splice _)   res_ty
   -- Since `tcApp` deals with `HsUntypedSplice` (in `splitHsApps`), you might
   -- wonder why we don't delegate to `tcApp` as we do for `HsVar`, etc.
   -- (See the initial block of equations for `tcExpr`.) But we can't do this
@@ -717,7 +718,7 @@ tcExpr (HsUntypedSplice splice _)   res_ty
   -- Note [Looking through Template Haskell splices in splitHsApps] in
   -- GHC.Tc.Gen.Head.
   = do { expr <- getUntypedSpliceBody splice
-       ; tcExpr expr res_ty }
+       ; tcExpr Nothing expr res_ty }
 
 {-
 ************************************************************************
@@ -727,9 +728,9 @@ tcExpr (HsUntypedSplice splice _)   res_ty
 ************************************************************************
 -}
 
-tcExpr (HsOverLabel {})    ty = pprPanic "tcExpr:HsOverLabel"  (ppr ty)
-tcExpr (SectionL {})       ty = pprPanic "tcExpr:SectionL"    (ppr ty)
-tcExpr (SectionR {})       ty = pprPanic "tcExpr:SectionR"    (ppr ty)
+tcExpr _ (HsOverLabel {})    ty = pprPanic "tcExpr:HsOverLabel"  (ppr ty)
+tcExpr _ (SectionL {})       ty = pprPanic "tcExpr:SectionL"    (ppr ty)
+tcExpr _ (SectionR {})       ty = pprPanic "tcExpr:SectionR"    (ppr ty)
 
 
 {-
@@ -744,14 +745,14 @@ tcXExpr :: XXExprGhcRn -> ExpRhoType -> TcM (HsExpr GhcTc)
 
 tcXExpr (PopErrCtxt e) res_ty
   = popErrCtxt $ -- See Part 3 of Note [Expanding HsDo with XXExprGhcRn] in `GHC.Tc.Gen.Do`
-      tcExpr e res_ty
+      tcExpr Nothing e res_ty
 
 tcXExpr (ExpandedThingRn o@(OrigStmt stmt flav) e) res_ty
    = addThingCtxt o $
        mkExpandedStmtTc stmt flav <$>
-       tcApp (Just o) e res_ty
+       tcExpr (Just o) e res_ty
 
--- For record selection
+-- For record selection, etc
 tcXExpr xe res_ty = tcApp Nothing (XExpr xe) res_ty
 
 


=====================================
compiler/GHC/Tc/Gen/Expr.hs-boot
=====================================
@@ -1,6 +1,6 @@
 module GHC.Tc.Gen.Expr where
 import GHC.Hs              ( HsExpr, LHsExpr, SyntaxExprRn
-                           , SyntaxExprTc )
+                           , SyntaxExprTc, HsThingRn )
 import GHC.Tc.Utils.TcType ( TcRhoType, TcSigmaType, TcSigmaTypeFRR
                            , SyntaxOpType
                            , ExpType, ExpRhoType, ExpSigmaType )
@@ -9,7 +9,7 @@ import GHC.Tc.Types.BasicTypes( TcCompleteSig )
 import GHC.Tc.Types.Origin ( CtOrigin )
 import GHC.Core.Type ( Mult )
 import GHC.Hs.Extension ( GhcRn, GhcTc )
-
+import GHC.Prelude ( Maybe )
 tcCheckPolyExpr, tcCheckPolyExprNC ::
           LHsExpr GhcRn
        -> TcSigmaType
@@ -28,7 +28,7 @@ tcPolyLExpr    :: LHsExpr GhcRn -> ExpSigmaType -> TcM (LHsExpr GhcTc)
 tcPolyLExprSig :: LHsExpr GhcRn -> TcCompleteSig -> TcM (LHsExpr GhcTc)
 
 tcPolyExpr :: HsExpr GhcRn -> ExpSigmaType -> TcM (HsExpr GhcTc)
-tcExpr     :: HsExpr GhcRn -> ExpRhoType   -> TcM (HsExpr GhcTc)
+tcExpr     :: Maybe HsThingRn -> HsExpr GhcRn -> ExpRhoType   -> TcM (HsExpr GhcTc)
 
 tcInferRho, tcInferRhoNC ::
           LHsExpr GhcRn -> TcM (LHsExpr GhcTc, TcRhoType)


=====================================
compiler/GHC/Tc/Gen/Head.hs
=====================================
@@ -545,7 +545,7 @@ tcInferAppHead (fun,ctxt)
     do { mb_tc_fun <- tcInferAppHead_maybe fun
        ; case mb_tc_fun of
             Just (fun', fun_sigma) -> return (fun', fun_sigma)
-            Nothing -> tcInfer (tcExpr fun) }
+            Nothing -> tcInfer (tcExpr Nothing fun) }
 
 tcInferAppHead_maybe :: HsExpr GhcRn
                      -> TcM (Maybe (HsExpr GhcTc, TcSigmaType))


=====================================
compiler/GHC/Tc/Gen/Match.hs
=====================================
@@ -340,12 +340,13 @@ tcDoStmts ListComp (L l stmts) res_ty
 
 tcDoStmts doExpr@(DoExpr _) ss@(L _ stmts) res_ty
   = do  { expanded_expr <- expandDoStmts doExpr stmts -- Do expansion on the fly
-        ; mkExpandedExprTc (HsDo noExtField doExpr ss) <$> tcExpr expanded_expr res_ty
+        ; traceTc "tcDoStmts" (ppr expanded_expr)
+        ; mkExpandedExprTc (HsDo noExtField doExpr ss) <$> tcExpr Nothing expanded_expr res_ty
         }
 
 tcDoStmts mDoExpr@(MDoExpr _) ss@(L _ stmts) res_ty
   = do  { expanded_expr <- expandDoStmts mDoExpr stmts -- Do expansion on the fly
-        ; mkExpandedExprTc (HsDo noExtField mDoExpr ss) <$> tcExpr expanded_expr res_ty  }
+        ; mkExpandedExprTc (HsDo noExtField mDoExpr ss) <$> tcExpr Nothing expanded_expr res_ty  }
 
 tcDoStmts MonadComp (L l stmts) res_ty
   = do  { stmts' <- tcStmts (HsDoStmt MonadComp) tcMcStmt stmts res_ty



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/1d2aeaa17303e0b24decf525fe3340fec9e3404f

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/1d2aeaa17303e0b24decf525fe3340fec9e3404f
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/20250209/7d5cc414/attachment-0001.html>


More information about the ghc-commits mailing list