
Apoorv Ingle pushed to branch wip/spj-apporv-Oct24 at Glasgow Haskell Compiler / GHC Commits: 0b60a5d1 by Apoorv Ingle at 2025-06-23T23:45:45-05:00 accept the right test output - - - - - e74f1260 by Apoorv Ingle at 2025-06-23T23:54:47-05:00 make make sure to set inGenerated code for RecordUpdate checks - - - - - 2 changed files: - compiler/GHC/Tc/Gen/Expr.hs - testsuite/tests/printer/T17697.stderr Changes: ===================================== compiler/GHC/Tc/Gen/Expr.hs ===================================== @@ -650,20 +650,20 @@ tcExpr expr@(RecordUpd { rupd_expr = record_expr do { -- Expand the record update. See Note [Record Updates]. ; (ds_expr, ds_res_ty, err_ctxt) <- expandRecordUpd record_expr possible_parents rbnds res_ty - - -- Typecheck the expanded expression. - ; expr' <- addErrCtxt err_ctxt $ - setInGeneratedCode (OrigExpr expr) $ - tcExpr ds_expr (Check ds_res_ty) - -- NB: it's important to use ds_res_ty and not res_ty here. - -- Test case: T18802b. - - ; addErrCtxt err_ctxt $ tcWrapResultMono expr expr' ds_res_ty res_ty - -- We need to unify the result type of the expanded - -- expression with the expected result type. - -- - -- See Note [Unifying result types in tcRecordUpd]. - -- Test case: T10808. + ; addErrCtxt err_ctxt $ + setInGeneratedCode (OrigExpr expr) $ + do { -- Typecheck the expanded expression. + expr' <- tcExpr ds_expr (Check ds_res_ty) + -- NB: it's important to use ds_res_ty and not res_ty here. + -- Test case: T18802b. + + ; tcWrapResultMono expr expr' ds_res_ty res_ty + -- We need to unify the result type of the expanded + -- expression with the expected result type. + -- + -- See Note [Unifying result types in tcRecordUpd]. + -- Test case: T10808. + } } tcExpr e@(RecordUpd { rupd_flds = OverloadedRecUpdFields {}}) _ ===================================== testsuite/tests/printer/T17697.stderr ===================================== @@ -1,7 +1,3 @@ -T17697.hs:5:8: warning: [GHC-81995] [-Wunused-do-bind (in -Wall)] - A do-notation statement discarded a result of type - ‘GHC.Internal.Types.ZonkAny 1’ - Suggested fix: Suppress this warning by saying ‘_ <- threadDelay 1’ - T17697.hs:6:5: warning: [GHC-88464] [-Wdeferred-out-of-scope-variables (in -Wdefault)] Variable not in scope: threadDelay :: t0 -> IO a0 + View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/7282035491eb8210ccb78544a1d0419... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/7282035491eb8210ccb78544a1d0419... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Apoorv Ingle (@ani)