Apoorv Ingle pushed to branch wip/spj-apporv-Oct24 at Glasgow Haskell Compiler / GHC
Commits:
-
1d4f129b
by Apoorv Ingle at 2025-11-17T10:42:07-06:00
3 changed files:
Changes:
| ... | ... | @@ -2002,19 +2002,19 @@ quickLookArg1 pos app_lspan (fun, fun_lspan) larg@(L _ arg) sc_arg_ty@(Scaled _ |
| 2002 | 2002 | |
| 2003 | 2003 | ; case mb_fun_ty of {
|
| 2004 | 2004 | Nothing -> skipQuickLook app_lspan larg sc_arg_ty ; -- fun is too complicated
|
| 2005 | - Just (tc_fun, fun_sigma) ->
|
|
| 2005 | + Just (tc_fun_arg_head, fun_sigma_arg_head) ->
|
|
| 2006 | 2006 | |
| 2007 | 2007 | -- step 2: use |-inst to instantiate the head applied to the arguments
|
| 2008 | - do { let tc_head = (tc_fun, fun_lspan)
|
|
| 2008 | + do { let arg_tc_head = (tc_fun_arg_head, fun_lspan_arg)
|
|
| 2009 | 2009 | ; do_ql <- wantQuickLook rn_fun_arg
|
| 2010 | 2010 | ; code_orig <- getSrcCodeOrigin
|
| 2011 | 2011 | ; let arg_orig | not (isGeneratedSrcSpan fun_lspan_arg)
|
| 2012 | - = exprCtOrigin fun
|
|
| 2012 | + = exprCtOrigin rn_fun_arg
|
|
| 2013 | 2013 | | otherwise
|
| 2014 | 2014 | = srcCodeOriginCtOrigin fun code_orig
|
| 2015 | 2015 | ; ((inst_args, app_res_rho), wanted)
|
| 2016 | 2016 | <- captureConstraints $
|
| 2017 | - tcInstFun do_ql True (arg_orig, rn_fun_arg, fun_lspan_arg) tc_fun fun_sigma rn_args
|
|
| 2017 | + tcInstFun do_ql True (arg_orig, rn_fun_arg, fun_lspan_arg) tc_fun_arg_head fun_sigma_arg_head rn_args
|
|
| 2018 | 2018 | -- We must capture type-class and equality constraints here, but
|
| 2019 | 2019 | -- not equality constraints. See (QLA6) in Note [Quick Look at
|
| 2020 | 2020 | -- value arguments]
|
| ... | ... | @@ -2049,7 +2049,7 @@ quickLookArg1 pos app_lspan (fun, fun_lspan) larg@(L _ arg) sc_arg_ty@(Scaled _ |
| 2049 | 2049 | ; return (EValArgQL { eaql_loc_span = app_lspan
|
| 2050 | 2050 | , eaql_arg_ty = sc_arg_ty
|
| 2051 | 2051 | , eaql_larg = larg
|
| 2052 | - , eaql_tc_fun = tc_head
|
|
| 2052 | + , eaql_tc_fun = arg_tc_head
|
|
| 2053 | 2053 | , eaql_rn_fun = rn_fun_arg
|
| 2054 | 2054 | , eaql_fun_ue = fun_ue
|
| 2055 | 2055 | , eaql_args = inst_args
|
| ... | ... | @@ -1506,7 +1506,6 @@ expandRecordUpd record_expr possible_parents rbnds res_ty |
| 1506 | 1506 | , text "ds_res_ty:" <+> ppr ds_res_ty
|
| 1507 | 1507 | , text "ds_expr:" <+> ppr ds_expr
|
| 1508 | 1508 | ]
|
| 1509 | - |
|
| 1510 | 1509 | ; return (ds_expr, ds_res_ty, RecordUpdCtxt relevant_cons upd_fld_names ex_tvs) }
|
| 1511 | 1510 | |
| 1512 | 1511 |
| ... | ... | @@ -465,7 +465,7 @@ tcInferAppHead_maybe fun = |
| 465 | 465 | case fun of
|
| 466 | 466 | HsVar _ nm -> Just <$> tcInferId nm
|
| 467 | 467 | XExpr (HsRecSelRn f) -> Just <$> tcInferRecSelId f
|
| 468 | - XExpr (ExpandedThingRn o e) -> Just <$> (addExpansionErrCtxt o (srcCodeOriginErrCtxMsg o) $
|
|
| 468 | + XExpr (ExpandedThingRn _ e) -> Just <$> (addExpansionErrCtxt o (srcCodeOriginErrCtxMsg o) $ -- ANI: TODO this is fishy..
|
|
| 469 | 469 | -- We do not want to instantiate c.f. T19167
|
| 470 | 470 | tcExprSigma False e
|
| 471 | 471 | )
|