Apoorv Ingle pushed to branch wip/spj-apporv-Oct24 at Glasgow Haskell Compiler / GHC Commits: 1d41e25c by Apoorv Ingle at 2026-03-22T13:56:13-05:00 remove unused function - - - - - 32ec61ae by Apoorv Ingle at 2026-03-22T14:03:26-05:00 account for rebase changes - - - - - 4 changed files: - compiler/GHC/HsToCore/Expr.hs - compiler/GHC/Tc/Gen/Do.hs - compiler/GHC/Tc/Types/LclEnv.hs - compiler/GHC/Tc/Types/Origin.hs Changes: ===================================== compiler/GHC/HsToCore/Expr.hs ===================================== @@ -719,13 +719,13 @@ ds_app (XExpr (ConLikeTc con)) _hs_args core_args ds_app (XExpr (HsRecSelTc (FieldOcc { foLabel = L _ sel_id }))) _hs_args core_args = ds_app_rec_sel sel_id sel_id core_args -ds_app (XExpr (ExpandedThingTc _orig e)) hs_args core_args - = ds_app e hs_args core_args +ds_app (XExpr (ExpandedThingTc (HSE _orig e))) hs_args core_args + = ds_app (unLoc e) hs_args core_args -- NB: this is important for the 'getField' case of 'ds_app_var', which needs -- to see all type arguments to 'getField' at once, while for record field -- projections such as (.fld) we may get: -- - -- XExpr (ExpandedThingTc (.fld) (getField @Symbol @LiftedRep @LiftedRep "fld")) + -- XExpr (ExpandedThingTc (HSE (.fld) (getField @Symbol @LiftedRep @LiftedRep "fld"))) -- `HsAppType` rec_ty `HsAppType` fld ds_app (HsVar _ lfun) hs_args core_args ===================================== compiler/GHC/Tc/Gen/Do.hs ===================================== @@ -451,7 +451,7 @@ It stores the original statement (with location) and the expanded expression of the error context stack which contains the error message for the previous statement: eg. "In the stmt of a do block: e1". This popping is implicitly done when we push the error context message for the next statment. - See Note [ErrCtxtStack Manipulation] and `LclEnv.setLclCtxtHsCtxt` + See `LclEnv.setLclCtxtHsCtxt` Sans the popping business for error context stack, if there were to be a type error in `e2`, we would get a spurious and confusing error message ===================================== compiler/GHC/Tc/Types/LclEnv.hs ===================================== @@ -89,10 +89,6 @@ data TcLclEnv -- Changes as we move inside an expression tcl_errs :: TcRef (Messages TcRnMessage) -- Place to accumulate diagnostics } --- | Get the top of the error message stack -get_err_ctxt_stack_head :: ErrCtxtStack -> HsCtxt -get_err_ctxt_stack_head (e : _) = e -get_err_ctxt_stack_head _ = error "get_err_ctxt_stack_head: oops! Empty error message stack" data TcLclCtxt = TcLclCtxt { @@ -176,7 +172,7 @@ setLclEnvHsCtxt ec = modifyLclCtxt (setLclCtxtHsCtxt ec) setLclCtxtHsCtxt :: HsCtxt -> TcLclCtxt -> TcLclCtxt setLclCtxtHsCtxt ec lclCtxt - -- Never stack 2 statement error contexts on top of each other + -- Never stack 2 do statement error messages on top of each other | StmtErrCtxt{} : ecs <- tcl_err_ctxt lclCtxt , StmtErrCtxt{} <- ec = lclCtxt { tcl_err_ctxt = ec : ecs } ===================================== compiler/GHC/Tc/Types/Origin.hs ===================================== @@ -916,7 +916,7 @@ foldMapCtOrigin f = go DerivOriginDC {} -> f orig DerivOriginCoerce {} -> f orig DefaultOrigin {} -> f orig - DoOrigin {} -> f orig + DoStmtOrigin {} -> f orig DoPatOrigin {} -> f orig MCompOrigin {} -> f orig MCompPatOrigin {} -> f orig View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/46c6db620daa35fbf9e05e5149b23a4... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/46c6db620daa35fbf9e05e5149b23a4... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Apoorv Ingle (@ani)